awk:introduction_to_awk
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
awk:introduction_to_awk [2020/05/04 22:53] – created peter | awk:introduction_to_awk [2021/01/06 15:16] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== AWK - Introduction to AWK ====== | ||
- | |||
- | **AWK** is a programming-language tool used to manipulate text. | ||
- | |||
- | It allows you to create short programs that read input files, sort data, process it, perform arithmetic on the input, and generate reports, among myriad other functions. | ||
- | |||
- | The language of the AWK utility resembles the shell-programming language in many areas, although AWK’s syntax is very much its own. | ||
- | |||
- | When first created, AWK was designed to work in the text-processing arena, and the language is based on executing a series of instructions whenever a pattern is matched in the input data. | ||
- | |||
- | * The utility scans each line of a file, looking for patterns that match those given on the command line. | ||
- | * If a match is found, it takes the next programming step. If no match is found, it then proceeds to the next line. | ||
- | |||
- | The general syntax for the command is: | ||
- | |||
- | <code bash> | ||
- | awk ' | ||
- | </ | ||
- | |||
- | ...where pattern represents what AWK is looking for in the data, and action is a series of commands executed when a match is found. | ||
- | |||
- | Curly brackets ({}) are not always required around your program, but they are used to group a series of instructions based on a specific pattern. | ||
awk/introduction_to_awk.1588632788.txt.gz · Last modified: 2020/07/15 09:30 (external edit)