Temporary files don't bite, so just use them.
Archive of posts filed under the sed category.
Removing newlines in text files
A task that comes up every so often, for some reason
Working with blocks in sed
How to recognize blocks of text with sed
Using different delimiters in sed
How to make sed programs more readable