June 2019
Intermediate to advanced
328 pages
7h 27m
English
awk lets you process text in a number of ways. You can use it to extract fields in a file, calculate totals, and even change the order of the output of a file. awk is a command-line utility, but it’s also a scripting language with loops, variables, and conditionals.
Much like sed, awk works slightly differently depending on the version installed on your operating system. On Ubuntu, the awk command that ships out-of-the-box is missing a few features, so install a more full-featured version before moving on:
| | $ sudo apt install gawk |
Let’s explore awk by using some data from the 2010 U.S. Census that shows population by state. You can find the full dataset in the book’s code download, but you’ll use ...