Linked by Thom Holwerda on Tue 27th May 2008 13:08 UTC, submitted by Ward D
General Development AWK is one of the most common UNIX tools to process text-based data in either files or datastreams. Written by Alfred Aho, Peter Weinberger, and Brian Kernighan, AWK "extensively uses the string datatype, associative arrays (that is, arrays indexed by key strings), and regular expressions." ComputerWorld interviewed Alfred Aho.
Permalink for comment 315867
To read all comments associated with this story, please click here.
RE[3]: what an wonderful tool
by malkia on Wed 28th May 2008 00:23 UTC in reply to "RE[2]: what an wonderful tool"
malkia
Member since:
2005-07-17

First, thanks for the nice AWK tips there. I should learn more AWK.

I'm still using only cut, sed, tr, etc.... I'm working mostly on Windows (which I do not like much) but that's my job - so cygwin on the help.

As for your example for cut and white spaces, here is how it can be solved:

cut --help | sed -r "s/[ ]+/ /g" | cut "-d " -f 2-

I guess sed can be used to replace two or more spaces to one, and then preprocess...

Reply Parent Bookmark Score: 1