in reply to Edit complex file

the keyword lines do not contain tabs, right? then:
my @fields; my $i = 0; while ( my $line = <$FILE> ) { chomp $line; if ( $line =~ /\t/ ) { if ($i > 0 ) { # do smth with last @fields array } @fields = split "\t", $line; $i++; } else { push @fields, $line; } }
UPDATE: @fields contains the last line after finishing the while loop.

Replies are listed 'Best First'.
Re^2: Edit complex file
by Anonymous Monk on May 03, 2006 at 14:36 UTC
    thanks for that...think i've corrected the file! cheers