Awk — a pattern scanning and processing language

Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger

Research output: Contribution to journalArticlepeer-review

80 Scopus citations


This paper describes the design and implementation of awk, a programming language which searches a set of files for patterns, and performs specified actions upon records or fields of records which match the patterns. Awk makes common data selection and transformation operations easy to express; for example, (Formula Presented.) is a complete awk program that prints all input lines whose length exceeds 72 characters. The program (Formula Presented.) prints each input line with the first field replaced by its logarithm. The program (Formula Presented.) prints all lines in which the first field is different from the first field of the previous line. Patterns may include boolean combinations of regular expressions and of relational operators on strings, numbers, fields, variables, and array elements. Actions may include: the same matching constructions as in patterns; arithmetic and string expressions and assignments; if‐else, while, and for statements; formatted output; and multiple output streams.

Original languageEnglish (US)
Pages (from-to)267-279
Number of pages13
JournalSoftware: Practice and Experience
Issue number4
StatePublished - Apr 1979
Externally publishedYes

All Science Journal Classification (ASJC) codes

  • Software


  • Report generation


Dive into the research topics of 'Awk — a pattern scanning and processing language'. Together they form a unique fingerprint.

Cite this