[TipJar] Common Punk: replace my text

No Comments

The SOA server I am currently working with had a nasty quirk on its services that I havent figured out yet on how to fix: it fails on requests with an XML comment. We use SOAPUI to trigger requests and the quirk requires most of us to strip the comments that is automatically generated by the tool. This quirk however gives me a good segue on this IT tipjar: how to leverage pattern matching to batch remove comments. This should serve as an introduction in other pattern matching applications when dealing with text/ascii content.
More

Sed: reduce multiple spaces to single space

No Comments

sed ’s/[ t]+/ /g’ input-file

or

echo “Some    random   text.   🙂 ” | sed ’s/[ t]+/ /g’

You have no idea how often I forget this useful snippet. 😀