OK, so I thought we'd talked about something like this before, but I
couldn't find it.
I have a CSV file where each line may NOT have the same number of fields.
One item per line.
But occasionally a field in an item will have one or more newlines in it.
How can I break this up correctly?
Thanks.
On Fri, Jun 08, 2007 at 03:26:56PM -0400, Alex Brelsfoard wrote:
> I have a CSV file where each line may NOT have the same number of fields.
> One item per line.
xSV is line oriented: as long as each line is well formed it should be parsed
correctly. Making sense of the data may be more difficult
On 6/8/07, Gyepi SAM <[EMAIL PROTECTED]> wrote:
> On Fri, Jun 08, 2007 at 03:26:56PM -0400, Alex Brelsfoard wrote:
> > I have a CSV file where each line may NOT have the same number of fields.
> > One item per line.
>
> xSV is line oriented: as long as each line is well formed it should be parsed
>
i have run into this problem before here's my code
foreach my $file (@$args){
#replace all newlines that are not imediately
# surrounded by quotes with a space
my $text = read_file( $file ) or die("Couldn't open $file for
preprocessing");
$text =~ s/([^\"])\r?
Oops. i went too fast. thats a preprocess command that i use with
App::Cmd (highly recommended by the way) $args is an arrayref of
filepaths read_file is provided by File::Slurp the regex is what you
are looking for. The problem sucks since its a badly formatted file,
but i normally just run that a
5 matches
Mail list logo