Originally Posted by jlightner
sed would be better than awk for command line.
I think that I would word that differently. Awk would be preferable for structured text files. Sed may be better for editing free form text. In either case, if the original pattern is split between a line, it may be better to use a sed script. You need to build lines in the pattern or hold space so that you can match a pattern containing the "\n" character. There is a book on Sed & Awk available on the web. ( It is the first edition that is available) The order of sed commands are important in a script and some possible input patterns can make the solution non-trivial.