Posted on :: Tags: ,
  • awk is run using awk 'awk_program' data-file
  • awk programs have the form pattern { action }; pattern { action };
  • BEGIN blocks are executed before reading data files
  • END blocks are executed after reading data files
  • NR is a variable that tells us the number of rows read
  • -F '<separator>' is how we can define a field separator for a file
  • Space is the default field separator
  • FPAT="..." is a way to use regex to define a pattern for each field
  • FPAT is only defined in gawk