Linked by pkrumins on Thu 19th Feb 2009 12:17 UTC
General Development If you have ever been interested in awk and sed Unix utilities, then you probably know about the awk1line.txt and sed1line.txt files that are floating around the Internet. Each file contains around 80 idiomatic sed and awk one-liners for performing various text modification tasks.
Permalink for comment 349936
To read all comments associated with this story, please click here.
Michael
Member since:
2005-07-01

Regular expressions are very powerful but they cover a limited range of problems between the the trivial (the title is the example given to trim whitespace) and the very complex.

These old UNIX tools were terific in their day when they were the only way of doing things. But I think the fact that they continue to get so much air time has more to do with the fact that it's fun play with them. They're like crossword clues.

Don't underestimate what you can do with Python. It's trivial to read in a text file and split it into an array using whatever seperator you want. Modern scripting languages have tremendously powerful string handling functions and they do all this using real words. RE's are there if you need them but you very rarely do.

My work rate isn't limited by the speed at which I type, it's limited by the speed at which I think (that is, severely limited). I think better if I'm not having to translate everything via these arcane hieroglyphics.

I wish people were better at distinguishing between a genuinely held (and valid) opinion and a troll. It is only my opinion.

Reply Parent Score: 1