|
Running awkLast revision August 6, 2004
Syntax to invoke awk:
At least one awk command must be specified, either directly on the command line, or in a script file whose name is specified after the -f option flag.
awk
works with input lines by first splitting them into "fields".
By default, a "field" is defined as all the characters up to a
blank or tab. Multiple contiguous blanks or tabs are treated as if
they were a single blank. So, for example, the input file line
11.4 0.4 452 folding layer10b.in You can tell awk to split the line into fields according to an alternate delimiter character using the -F option on the awk command line. Follow the option immediately with the desired delimiter, with no intervening spaces, for example, -F: if you want to split the line into fields based on the colon (:) character. The delimiter characters themselves are not considered part of the fields. If you explicitly set the delimiter character like this, then each occurrence of that delimiter on the input line starts a new field. Two delimiter characters in a row define an empty field. This is the opposite behavior from the default case, where any number of blanks or tabs in a row are treated as if they were a single blank delimiter character. awk reads all the lines from all the input files listed on the command line, or from standard input if no files are specified, and writes processed or selected lines or other output to standard output. Generally, you want to redirect standard output to a file.
|