Thursday, July 10, 2008

Understanding Unix AWK

Understanding Unix AWK

awk is field-oriented and ideal for manipulating database or comma-delimited files
  1. awk '{ print $1 }' address_book
  2. awk -F, '{ print $1 }' address_book
  3. awk -F, '{ print $1 " " $2 " " $8 }' address_book > address_book.bck
  4. awk -F, '/KARAM/{ print $1 " " $2 " " $8 }' address_book > address_book.bck

No comments: