Monday, March 22, 2010

Using AWK to remove newlines from text

This is an AWK one liner that comes in handy. It will strip newlines from it's input replacing them with a single space. I often use it in conjunction with things such as svn, cut, sed and grep.

awk -v RS="\n" -v ORS=" " {print}

Print this post

No comments: