Friday, December 23, 2011

LoReM iPsUM awk

Did you ever get a list of stuff, like email addresses or domain names or something, and the person who gave it to you did crazy capitalization?  Some are all lowercase, some are uppercase, but the only thing that's consistent is there's no commonality.

awk to the rescue again.

Let's assume you have a list of stuff you've copied and pasted into a text file called delete.txt.  This one-liner will amend your ailment:
 cat delete.txt |awk '{print tolower ($0)}'

Voila.

No comments:

Post a Comment