Awk does not introduce much, one of the best text processing tools
One, built-in variable table
| Property |
Description |
| $ |
Current record (as a single variable) |
| $1~ $n |
The nth field of the current record, separated by FS between fields |
| Fs |
Input field delimiter is blank by default |
| Nf |
The number of fields in the current record, that is, how many columns |
| Nr |
The number of records that have been read is the line number, starting from 1 |
| Rs |
Enter the record he defaults to think of a newline character |
| OFS |
The output field delimiter is also a space by default |
| ORS |
Record delimiter for output, default to line break |
| ARGC |
Number of command line arguments |
| Argv |
Array of command-line arguments |
| FILENAME |
The name of the current input file |
| IGNORECASE |
If true, ignores case matching |
| Argind |
argv identifier of the currently processed file |
| Convfmt |
Digital conversion Format%.6g |
| ENVIRON |
UNIX Environment variables |
| Errno |
UNIX System error messages |
| FieldWidths |
Blank delimited string for input field width |
| FNR |
Current Record Count |
| Ofmt |
The output format of the number%.6g |
| Rstart |
The first string matched by the matching function |
| Rlength |
String lengths matched by matching function |
| Subsep |
\034 |
awk abridged textbook