in reply to CSV data processing
Your question doesn't make sense. Text::CSV parses lines (which is weakness of the module), not files.
Maybe what you want is Text::xSV. Consider:
use strict; use warnings; use Text::xSV; my $str = <<FILE; a,2,"3 a",4,5,6 b,2,3,4,5,6 FILE open my $inFile, '<', \$str; my $xsv = Text::xSV->new (fh => $inFile); $xsv->bind_fields (qw(1 2 3 4 5 6)); while (my @parts = $xsv->get_row ()) { s!\n!!g for @parts; print "@parts\n"; } close $inFile;
Prints:
a 2 3a 4 5 6 b 2 3 4 5 6
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CSV data processing
by CountZero (Bishop) on Dec 09, 2008 at 23:20 UTC | |
by GrandFather (Saint) on Dec 10, 2008 at 00:07 UTC | |
by ikegami (Patriarch) on Dec 10, 2008 at 00:43 UTC | |
by CountZero (Bishop) on Dec 10, 2008 at 06:53 UTC | |
by normskib (Initiate) on Dec 10, 2008 at 09:58 UTC |