Example 7-8. examples/arrays/process_csv_file_short.pl
while (<>) {
$sum += (split ",")[2];
}
print "$sum\n";
Use the following command to run the script:
perl examples/arrays/process_csv_file_short.pl examples/arrays/process_csv_file.csv
See also the oneliners
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| process csv file | Up | process csv file using Text::CSV_XS |