package CSV @ISA = qw() sub GetArraysFromFileSimple my ($path, $IsPrint, $SkipBlankData) = @_; return (undef) if(!$CSV->ReadSimple($path, undef, $IsPrint)); return (0, $pLabelArray, @$pDataArray) if(!$pDataArray); return ($nData, $pLabelArray, @$pDataArray); sub GetArraysFromFile my ($path, $IsNumerical, $IsPrint) = @_; return (undef) if(!$CSV->Read($path, $IsNumerical, $IsPrint)); return (0, $pLabelArray, @$pDataArray) if(!$pDataArray); return ($nData, $pLabelArray, @$pDataArray); sub RemakeDataArrayFromFile my ($path, $pX, $IsXStepConstant) = @_; return undef if(!defined $nData); return @ConvDataArray; sub BEGIN sub new my ($module) = @_; return $this; sub DESTROY my $this = shift; sub SkipBlankData return shift->{SkipBlankData}; sub SetSkipBlankData my ($this, $f) = @_; return $this->{SkipBlankData} = $f; sub WriteLabelLine my ($this, @LabelArray) = @_; return $this->{'JFile'}->Write("$line\n"); sub Quote my ($this, $str) = @_; return "\"$str\"" if($str =~ /[,\r\n]/); return $str; sub WriteDataLine my ($this, $pArray) = @_; return undef unless($this->{'JFile'}); return $this->{'JFile'}->Write("$line\n"); return 1; sub ConvertToCSVFormat my @values = @_; return $line; sub Open my ($this, $filename, $mode, $IsNumerical) = @_; return $this->{JFile} = new JFile($filename, $mode); sub Close my ($this) = @_; return if(!$this->{JFile}); sub eof my ($this) = @_; return if(!$this->{JFile}); sub rewind my ($this) = @_; return if(!$this->{JFile}); sub ReadNextLine my ($this) = @_; return if(!$this->{JFile}); return @a; sub GetHashData my ($this, $idx) = @_; return undef if(!defined $pDataArray->[0]->[$idx]); return \%hash; sub nValidItems return $n; sub ReadFreeFormat my ($this, $filename, $separator, $pLabelArray, $IsNumerical, $IsPrint, $nMinimumLabels) = @_; return undef unless($in); return undef unless($line); return 1; sub Read my ($this, $filename, $IsNumerical, $IsPrint, $nMinimumLabels, $ReadCheckFunc) = @_; return undef unless($in); return undef unless($line); return 1; sub ReadSimple my ($this, $filename, $IsNumerical, $IsPrint) = @_; return undef unless($in); return undef unless($line); return 1; sub ReadSimple_prev my ($this, $filename, $IsNumerical, $IsPrint) = @_; return undef unless($in); return undef unless($line); return if($c > 2); return 1; sub Save my ($this, $filename, $pLabelArray, $pArray, $OutputInterval) = @_; return undef unless($out); return 1; package CSV sub TIEARRAY my ($class, $csvfile) = @_; return bless $this, $class; sub FETCH my ($this, $idx) = @_; return undef if $idx < 0 || $#{$this->{DATA}} < $idx; return $this->{DATA}[$idx]; sub STORE my ($this, $idx, $val) = @_; return if $val eq undef || $idx < 0; return if 'ARRAY' ne ref($val); sub DESTROY my ($this) = @_; sub sync my ($this) = @_; sub clear my ($this) = @_; sub rec my ($this) = @_; return scalar @{$this->{DATA}};