in reply to Two line match
Note the use of the flip-flop operator .. to select stuff between the tokens, and array slicing to avoid the delimiters.perl -ne "next unless /ghjghjgkhgkghj/../fsgdfgsdfgdfsgdsfg/;chomp;pus +h @l,$_;END{$r=join '', @l[1..$#l-1];print $r}" Your-file-name-here
"As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Two line match
by jrosenfeld (Initiate) on Mar 10, 2008 at 20:45 UTC |