--roboticus#!/usr/bin/perl -w use strict; use Text::CSV_XS; # Slurp up the whole file open(INF,"<test.mac") || die "Can't open test.mac!"; my $file = <INF>; close(INF); # Convert CRs to LFs $file =~ s/\015/\012/g; # Parse CSV file line-by-line my $csv = Text::CSV_XS->new(); for my $i (split /\012+/, $file) { my $status = $csv->parse($i); print "ST:", $status; for my $j ($csv->fields) { print " [", $j, "]"; } print "\n"; }
In reply to Re: Text::CSV_XS and line-endings
by roboticus
in thread Text::CSV_XS and line-endings
by friedo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |