in reply to Re: How to parse a tab delimited file
in thread How to parse a tab delimited file

Thanks for the help

Sorry for being a completely stupid monk, but how do I use this?

How can I call the new constructor setting the separator to tab (\t)?

I have this so far but it doesn't work.

my $csv = Text::xSV->new( filename => $csv_destination, sep => '\t', ); $csv->open_file("foo.csv"); $csv->read_header(); foreach my $field ($csv->get_fields) { if (lc($field) ne $field) { $csv->alias($field, lc($field)); } }

Complains about using The separator '\t' is not of length 1.

Thanks,
Tom

Replies are listed 'Best First'.
Re^3: How to parse a tab delimited file
by Happy-the-monk (Canon) on Nov 25, 2004 at 18:38 UTC

    sep => '\t',

    The separator '\t' is not of length 1.

    You get rid of that error if you specify it in double quotes:

    sep => "\t",

    Cheers, Sören