Posted on :: Tags: , ,
  • Awk is executed using awk 'awk_program' data-file.
  • Awk programs follow the form pattern { action }; pattern { action };.
  • BEGIN blocks are executed before reading the data files.
  • END blocks are executed after reading the data files.
  • NR is a variable that indicates the number of records (rows) read so far.
  • -F '<separator>' is used to define a field separator for a file.
  • A space is the default field separator.
  • FPAT is a regex used to define the pattern for each field.
  • FPAT is specifically defined in Gawk.