in reply to Re: Re: CRLF in a csv
in thread CRLF in a csv
undef $/; my $infile = (<>); my @fields = $infile =~ /(".*?"(?=,|\n)|\n)/gms; my $place = "\n"; foreach (@fields) { if ($place ne "\n" && $_ ne "\n") {print ",";}; unless ($_ eq "\n") {s/\n//g;}; print "$_"; $place = $_; }
|
|---|