while (<$fh_in>) { $csv->parse($_) or die("csv: " . $csv->error_diag() . "\n"); my @fields = $csv->fields(); if ($fields[9] == 32) { print $fh_kept $_; } else { print $fh_rejected $_; } }
Update: The OP talks about sorting the records, but he seems to just wants to filter them? Updated code.
In reply to Re: Commas in quoted CSV records
by ikegami
in thread Commas in quoted CSV records
by generator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |