## prints number of columns if it changed from previous line > awk -F"\t" 'NF != oldnf { print NF; oldnf = NF }' filename |head |head added just in case file is very long ## using a script > awk -f script.awk filename | head script.awk: BEGIN { FS="\t" oldnf = 1 } { if(NF != oldnf) { print NF oldnf = NF } } Other examples in http://sparky.rice.edu/~hartigan/awk.html
Friday, March 19, 2010
awk: verify same number of columns
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment