Skip to content
Q213970

File:The-AWK-Programming-Language.svg · Wikimedia Commons · See Wikimedia Commons

EntityQ213970· pop 50· linked from 360 articles

AWK () is a scripting language designed for text processing and typically used as a data extraction and reporting tool. Like sed and grep, it is a filter, and it is a standard feature of most Unix-like operating systems. The shell command that runs the AWK processor is named .

Key facts

Programming language.screenshot caption
Usage of AWK in shell to check matching fields in two files
Programming language.logo
The-AWK-Programming-Language.svg
Programming language.logo_size
200px
Programming language.screenshot
Awk-example-usage-gimp.gif
Programming language.screenshot_size
250px
Programming language.name
AWK
Programming language.paradigm
Scripting, procedural, data-driven
Programming language.latest_release_version
IEEE Std 1003.1-2008 (POSIX) / 1985
Programming language.designer
Alfred Aho, Peter Weinberger, and Brian Kernighan
Programming language.typing
none; can handle strings, integers and floating-point numbers; regular expressions
Programming language.implementations
awk, GNU Awk, mawk, nawk, MKS AWK, Thompson AWK (compiler), Awka (compiler)
Programming language.dialects
old awk oawk 1977, new awk nawk 1985, GNU Awk gawk
Programming language.influenced_by
C, sed, SNOBOL
Programming language.influenced
Tcl, AMPL, Perl, Korn Shell (ksh93, dtksh, tksh), Lua
Programming language.operating_system
Cross-platform

via Wikipedia infobox

Described at

Link to a page describing this subject · 40,000 chars · not written by Vinony

Source code

Link to the source-code README · 5,736 chars · not written by Vinony

Wikidata facts

Image
Awk-example-usage-gimp.gif
Show 7 more facts
software version identifier
IEEE Std 1003.1-2008
Stack Exchange tag
stackoverflow.com/tags/awk
inception
1977-00-00
media type
application/x-awk
source code repository URL
github.com/onetrueawk/awk
Commons category
AWK
Sources (6)

via Wikidata · CC0

~23 min read

Article

23 sections
Contents
  • History
  • Structure of AWK programs
  • Commands
  • The ''print'' command
  • Built-in variables
  • Variables and syntax
  • User-defined functions
  • Examples
  • Hello, World!
  • Print lines longer than 80 characters
  • Count words
  • Sum last word
  • Match a range of input lines
  • Printing the initial or the final part of a file
  • Calculate word frequencies
  • Match pattern from command line
  • Self-contained AWK scripts
  • Versions and implementations
  • Books
  • See also
  • References
  • Further reading
  • External links

AWK () is a scripting language designed for text processing and typically used as a data extraction and reporting tool. Like sed and grep, it is a filter, and it is a standard feature of most Unix-like operating systems. The shell command that runs the AWK processor is named .

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. While AWK has a limited intended application domain and was especially designed to support one-liner programs, the language is Turing-complete, and even the early Bell Labs users of AWK often wrote well-structured large AWK programs.

Gallery (34)

Connections

Categories