I. Command Format
Gawk options program file
Gawk options:
-F fs specifies the file delimiter used to describe the data fields in a row
-F file: Specifies the file name of the reader.
-V var = value defines the variables and default values used in the gawk program.
-Mf N specifies the maximum number of fields to be processed in the data file.
-Mr N specifies the maximum record size in the data file.
-W keyword: indicates the compatibility mode or warning level of gawk.
Ii. Read the program script from the command line
$ Gawk '{print "hello world "}'
(The default input file is STDIN)
3. Use data field variables
$0 full line of text
$ N data in the text line
The specified Delimiter is a space. By default <Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KCjxwPr/J0tTWuLaot9a49Lf7oaqhqs2ouf0gLUYgPC9wPgo8cD48aW1nIHNyYz0 = "" alt = "\">
4. Use multiple commands in the script
It can be used between variables and multiple commands.
5. Read program from file-f
To use multiple commands in a program, you only need to place one command in each line, without the need to use ";"
Vi. run scripts before and after Data Processing
Press ctrl + d to stop the input