The AWK Programming Language, 2nd Ed

Author: Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger
Publisher: Addison-Wesley
Pages: 240
ISBN: 978-0138269722
Print: 0138269726
Kindle: B0CCJ1N4X3
Audience: Developers interested in Awk
Rating: 5
Reviewer: Kay Ewbank

The name Brian Kernighan among the authors of this updated classic raises expectations as to the book's content, and it doesn't disappoint.

If anybody is in a position to write a definitive guide to Awk, it's Brian Kernighan, as he's one of the co-authors of the Unix tool - his surname supplied the K in the name. He's also been a major maintainer of the language until recently, finally handing over maintenance having worked on the most recent major update of Awk to add support for UTF-8 encoded text and CSV files.


To reflect the changes, he and his co-authors have updated this classic book that was last released in 1988. The new edition has been reorganized and covers the new features, with added material on data handling and exploration.

Awk is still popular partially because it's easy to learn, and is always available on UNIX, Linux, MacOS and usually on Windows. Kernighan describes it as a language that lets you write something in a short program, often in a single line of code, because Awk handles the 'baggage' that you need in other languages.


The book opens with an Awk tutorial that introduces the main commands and examples showing how Awk is used. This is further explored in the next chapter, Awk in action, which looks at selections, transformations, summarizations, and setting up a database.

A chapter on exploratory data analysis uses accessible examples including an analysis of passenger mortality data from the sinking of the Titanic; and working with a large dataset in the form of the beer ratings from RateBeer.

Data processing is covered next, with sections on data transformation and reduction, validation, and handling multiline records. A chapter on reports and databases then goes on and covers the use of packaged queries and reports.

A chapter on processing words looks at using Awk for the manipulation of natural language text; not an obvious use, but the examples include programs that generate words and phrases, carry on limited dialogs with users, and so on. The authors acknowledge that the examples are toys, but point out that some of the document preparation programs are in regular use.

Chapter 7 is titled 'Little Languages', and looks at the use of Awk to develop translators for languages for specific applications such as an assembler, interpreter, and calculators. The examples include a sort generator, reverse-polish calculator, and recursive-descent parsers for arithmetic expressions and a subset of Awk.

A chapter on 'experiments with algorithms' comes next with sections on sorting, profiling and topological sorting. There's also an extended example looking at Make, a file updating program.

The final chapter of the book considers Awk as a language, its history, and its strengths and weaknesses.

Overall, this is a well written, informative and authoritative book. Awk is a useful tool that is widely available, and this book tells you all you need to know.

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.


Artificial Intelligence and Expert Systems (Mercury Learning)

Authors: I. Gupta & G. Nagpa
Publisher: Mercury Learning
Pages: 412
ISBN: 978-1683925071
Print: 1683925076
Kindle: B087785GZM
Audience: Technically able readers
Rating: 4
Reviewer: Mike James
Expert Systems, anyone?

Machine Learning with PyTorch and Scikit-Learn

Author: Sebastian Raschka, Yuxi (Hayden) Liu & Vahid Mirjalili
Publisher: Packt
Date: February 2022
Pages: 770
ISBN: 978-1801819312
Print: 1801819319
Kindle: B09NW48MR1
Audience: Python developers interested in machine learning
Rating: 5
Reviewer: Mike James
This is a very big book of machine le [ ... ]

More Reviews