#!perl use strict; while (my $line = <DATA>){ if ($line =~ /line 1/){ print $line; next for 1..5; # skip 5 lines print $line; } } __DATA__ line 1 line 2 line 3 line 4 line 5 line 6 line 7
Perhaps you meant
poj#!perl use strict; while (my $line = <DATA>){ if ($line =~ /line 1/){ print $line; <DATA> for 1..5; $line = <DATA>; print $line; } }
In reply to Re^2: Perl solution for current batch file to extract specific column text
by poj
in thread Perl solution for current batch file to extract specific column text
by oryan
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |