geofisch has asked for the wisdom of the Perl Monks concerning the following question:
use strict; undef $/; my $infile = (<>); my @fields = $infile =~ /(".*?"|\n)/gms; my $place = "\n"; foreach (@fields) { if ($place ne "\n" && $_ ne "\n") {print ",";}; unless ($_ eq "\n") {s/\n//g;}; print "$_"; $place = $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CRLF in a csv
by Anonymous Monk on Apr 04, 2001 at 22:34 UTC | |
by geofisch (Initiate) on Apr 04, 2001 at 23:31 UTC | |
by geofisch (Initiate) on Apr 05, 2001 at 00:59 UTC | |
|
Re (tilly) 1: CRLF in a csv
by tilly (Archbishop) on Apr 05, 2001 at 06:55 UTC | |
by geofisch (Initiate) on Apr 05, 2001 at 17:37 UTC |