/ Published in: Bash
Find any line with beginning of line followed by zero or more tabs, spaces followed by end of line -- delete it.
Expand |
Embed | Plain Text
sed '/^[\t ]*$/d' file
Comments
Subscribe to comments
You need to login to post a comment.

Used in conjuction with http://snipplr.com/view/53323/merge-lines-with-sed/ and tr to prettify clunky Sybase output for collection codes. Basically just saves a tree.
sed -e '$!N;s/\n/ /' -e '/^[\t ]*$/d' collection_codes.txt | tr -s ' ' >collection_codes_pretty_print.txt