awk Overview

awk is a tool for processing rectangular data, in other words, data that looks like a spreadsheet, with a regular structure on every row. Each awk script is essentially a 1-liner, with an (optional) BEGIN section, a main section, and an (optional) END section. Often the entire awk script is only the main section. The main section of an awk script is executed one time per line of data, and usually consists of a transformation of the data or a retrieval of a portion of the data. The syntax for awk takes a little time to get used to. Once familiar with awk, it is possible make quick transformations of data using awk with just 1 line of work. Also, awk is really handy as a part of a larger bash pipeline of tools for transforming or extracting data.