DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Processing Columns

09.23.2006
| 7082 views |
  • submit to reddit
        print the first column, delimited by space 
nawk -Fc '{print $1}' test.txt

print the second column, delimited by : 
nawk -F: '{print $2}' test.txt