skip to main | skip to sidebar

ET Notes

Thursday, October 14, 2010

Verify that a file has constant number of fields.

# awk -F~ '{print NF}' < 20100912PATLAB.txt | sort | uniq
25


add -c to uniq to get count of occurrences.

# awk -F'\t' '{print NF}' < PTINFO.EXT | sort | uniq -c
4420846 38
3 39
3 40
1 41
3 42
Posted by Michael at 1:38 PM
Labels: awk fields

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2012 (1)
    • ►  July (1)
  • ►  2011 (7)
    • ►  August (2)
    • ►  July (1)
    • ►  April (2)
    • ►  March (1)
    • ►  January (1)
  • ▼  2010 (10)
    • ►  November (1)
    • ▼  October (5)
      • Transferring using ssh and pipes.
      • MySQL temp files in data
      • vim use sudo to save changes.
      • Verify that a file has constant number of fields.
      • Compare contents of 2 directories
    • ►  August (1)
    • ►  July (1)
    • ►  February (2)
  • ►  2009 (4)
    • ►  December (1)
    • ►  May (2)
    • ►  March (1)
  • ►  2008 (5)
    • ►  August (2)
    • ►  June (1)
    • ►  February (2)
  • ►  2007 (11)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  July (2)
    • ►  June (4)
    • ►  May (1)
    • ►  April (1)

About Me

Michael
View my complete profile