Skip to content
Next scheduled workshop
22 and 23 January, 2024, via Zoom

course material of the first day
course information

Why awk?


Awk is useful when the overhead of more sophisticated approaches is not worth the bother.

Quote

The Enlightened Ones say that...

  • You should never use C if you can do it with a script;
  • You should never use a script if you can do it with awk;
  • Never use awk if you can do it with sed;
  • Never use sed if you can do it with grep.

*source: (some years ago) http://awk.info/?whygawk

Objectives


  • The material on this site is not a complete guide or awk manual.
  • The purpose of this site is to give an overview of the capabilities of the awk language and to underline some particular strengths or disadvantages .
  • The page aims to promote this tool for use in every-days research work and urges you to find solutions yourself rather than expecting ready-made ones.
  • The material assumes that you are somewhat familiar with grep, sed and have some basic programming experience.

What is awk?


AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool. Wikipedia

The AWK language is a data-driven scripting language consisting of a set of actions to be taken against streams of textual data - either run directly on files or used as part of a pipeline - for purposes of extracting or transforming text, such as producing formatted reports. The language extensively uses the string datatype, associative arrays (that is, arrays indexed by key strings), and regular expressions.

AWK has a limited intended application domain, and was especially designed to support one-liner programs.

It is a standard feature of most Unix-like operating systems.

source: Wikipedia