in reply to Text::xSV quote problem

If you have tab-delimited data, with unquoted fields, and it is NOT a csv-like format, then Text::xSV is doing nothing useful for you. Just use split.
my $file = "xxxx.cvs"; open(my $fh, "<", $file) or die "Cannot read '$file': $!"; my $line = <$fh>; chomp($line); my @fields = split /\t/, lc($line), -1; while ($line = <$fh>) { chomp($line); my %row; @row{@fields} = split /\t/, $line, -1; # save to a db }

Replies are listed 'Best First'.
Re^2: Text::xSV quote problem
by cfreak (Chaplain) on Oct 03, 2006 at 22:15 UTC

    I would, unfortunately the requirements are to use Text::xSV, lots of files in the project use it and they want to remain consistent. It is also possible that the format will change to something that will need it

    I have solved the problem by using a filter function. Its kind of ugly but it works.

      Hmmm ... I must find some proverb or pithy saying that covers this situation .... ignoring the advice of the module's [id://tilly|author] is probably not in your best interest. Maybe I'm being too harsh (or maybe it's the repetiviness of always saying this to my four year old) - but you should at least say thank you.

      -derby