I strongly recommend you use Text::CSV for CSV input/output, your script will end up much more robust and probably a bit shorter (also install Text::CSV_XS for speed). I gave an example of CSV input and output here. Update: Copied over code example (with minor adaptations):
use warnings; use strict; use Text::CSV; my $csv = Text::CSV->new({ binary=>1, auto_diag=>2, eol=>$/, sep_char => ";" }); open my $ifh, '<', 'Input.CSV' or die $!; open my $ofh, '>', 'Output.CSV' or die $!; while ( my $row = $csv->getline($ifh) ) { # your logic to modify data here $csv->print($ofh, $row); } $csv->eof or $csv->error_diag; close $ifh; close $ofh;
In reply to Re: Removing doubles and printing only unique values
by haukex
in thread Removing doubles and printing only unique values
by zarath
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |