jake RSS


jakehofman.com

Archive

Sep
20th
Tue
permalink

tip: awk

check if a variable is numeric in awk func isnum(x) {return x==x+0} http://bit.ly/pTDTXW

tips  awk 
Sep
30th
Thu
permalink

tip: awk

use awk -v var=$bashvar to pass bash variables to awk scripts http://bit.ly/c4vjLc

tips  awk 
Jul
16th
Fri
permalink

tip: awk

nice 3 part series from gentoo, “awk by example” http://bit.ly/98jiD5

tips  awk 
permalink

tip: awk

nice 3 part series from gentoo, “awk by example” http://bit.ly/aaavNv

tips  awk 
Jun
8th
Tue
permalink

tip: awk

to use multiple characters as field separators use a regular expression, e.g. awk -F”[]” for http://bit.ly/cibp1l

tips  awk 
Mar
30th
Mon
permalink

tip: awk

to print all lines where, e.g., the second field matches a regex use awk ‘$2 ~ /regex/’ http://bit.ly/BVnN

tips  awk 
Apr
6th
Thu
permalink

tip: awk

to print even lines, NR %2. odd lines, ‘NR % 2 == 1’.

tips  awk 
Feb
15th
Wed
permalink

tip: awk

replace fields with nothing … {$1=”“; print $0;}

tips  awk 
Nov
14th
Mon
permalink

tip: awk

to ignore case, use IGNORECASE=1

tips  awk