in reply to switching characters
... open $fh ... $csv = Text::CSV_PP->new(); # create a new CSV parser object $csv->sep_char('|'); # look for the header line my $line = 0; my $col; while ($line < 20 && defined($col = $csv->getline($fh) )) { if ($csv->[0] eq '#') { # found it break; } $line++; } unless ($line < 20 && defined($col)) { die "header line not found\n"; } # process the rest of the file while (defined($col = $csv->getline($fh))) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: switching characters
by kevind0718 (Scribe) on Jan 11, 2008 at 20:54 UTC | |
by pc88mxer (Vicar) on Jan 11, 2008 at 21:14 UTC | |
by kevind0718 (Scribe) on Jan 11, 2008 at 21:24 UTC |