AWK blows me away

How did I not know this about awk!? Don’t get me wrong, I’m no awk expert; I’m always using some of the most simple and obvious features it has. But I almost always use the -F option to specify the field separator. Until today, I thought you could only give it either a single character or a string literal. Go ahead, laugh, I’ll wait.

From StackOverflow:

I just used this to help parse the output of drush pml. Since it uses more than one space to separate fields, I used

(that’s two spaces and a plus sign for the field separator). I initially tried using

but apparently that’s some kind of super advanced regex that awk doesn’t understand.

Another cool thing about the StackOverflow page is that one person shows how you can parse a CSV with embedded / escaped commas if you have gawk 4 installed:

AWK blows me away is original content from Devolve.

Author: Charlie Herron

Denizen of Portland, Maine; tech jack; lover / hater / whatever; philosophical dabbler.