in reply to Text::CSV_XS read file from line X
If you know how many header lines there are you want to skip then you can simply (using 2 lines in the example):
<$FH> for 1 .. 2;
before the while loop. If you need to test each line until you find the first data line you could (where headers lines start with skip):
while (! eof $FH) { my $start = tell $FH; my $line = <$FH>; next if $line =~ /^skip/; seek $FH, $start, 0; last; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Text::CSV_XS read file from line X
by tw (Acolyte) on Jan 04, 2011 at 07:57 UTC |