AWK Online Training
Introduction to AWK
- Basic Structure
- Executing an AWK script
- Which shell to use with AWK?
- The Essential Syntax of AWK
- Arithmetic Expressions
- Unary arithmetic operators
- The Autoincrement and Autodecrement Operators
Assignment Operators
Conditional expressions
Regular Expressions
Commands in AWK
AWK Built-in Variables
- FS - The Input Field Separator Variable
- OFS - The Output Field Separator Variable
- NF - The Number of Fields Variable
- NR - The Number of Records Variable
- RS - The Record Separator Variable
- ORS - The Output Record Separator Variable
- FILENAME - The Current Filename Variable
Associative Arrays
- Multi-dimensional Arrays
- Example of using AWK's Associative Arrays
Scripting Outputs
- Picture Perfect PRINTF Output
- PRINTF - formatting output
- Explicit File output
- Escape Sequences
- Format Specifiers
- Width - specifying minimum field size
- Left Justification
- The Field Precision Value
Exponents, logs and square roots
Truncating Integers
"Random Numbers
The Lotto script
Functions in AWK
- AWK Numerical Functions
- Trigonometric Functions
- String Functions
- The Length function
- The Index Function
- The Substr function
- GAWK's Tolower and Toupper function
- The Split function
- NAWK's string functions
- The Match function
- The System function
- The Getline function
- The systime function
- The Strftime function
- User Defined Functions
Formatting AWK programs
Environment Variables
- ARGC - Number or arguments (NAWK/GAWK)
- ARGV - Array of arguments (NAWK/GAWK)
- ARGIND - Argument Index (GAWK only)
- FNR (NAWK/GAWK)
- OFMT (NAWK/GAWK)
- RSTART, RLENGTH and match (NAWK/GAWK)
- SUBSEP - Multi-dimensional array separator (NAWK/GAWK)