I am parsing an Excel CSV file in OSX El Capitan, the CSV is here
The problem is newlines are marked as '\x0d' (CR).
1] I have been able to transform the file with newlines set as 'x0a' (NL) with
$> perl -e 'open(fh, "<coord2.csv") or die("can t open file");
binmode(fh); $/=\10;
while ($t=<fh>) { $t =~ s/\x0d/\x0a/g; print "$t"; } print "\n"; '
but before that i tried two other way and they failed, i would like to know if you have some exmplanation for the reason they fail.
2] I tried for a while to slurp all the file at once with:
$> cat coord2.csv | perl -e 'undef $/; $t=<>; print "$t \n"; '
but in output I don't see all the file, I see only:
Prelevacampioni ZARA;45.0640, 11.1943;F ;F 9.954467;F00;F599242;F
3] I tried also to set the $/
variable, with:
$> cat coord2.csv | perl -e '$/="\x0d"; @L=<>;
for (@L) { print $_; } print "\n"; '
but again, I see only the same output as in point [2].
I am puzzled, can you explain me what I am doing wrong in point [2] and [3] ?