in reply to range of lines

If you happen to want the matching line printed in addition to the 5 lines after it, you could use the .. operator like so:

perl -ne 'print if /PATTERN/ .. ++$c%6==0;' file.txt

Replies are listed 'Best First'.
Re^2: range of lines
by kesterkester (Hermit) on Jun 22, 2004 at 13:10 UTC
    Ahhh, that's a very clever way to do it. ++delirium!