awk usage in Linux

1. Introduction to awk: awk is a powerful text analysis tool. Compared with grep search and sed editing, awk is particularly powerful when it analyzes data and generates reports. Simply put, awk reads the file line by line, slices each line with a space as the default delimiter, and performs various analysis and processing on the cut part.


2, awk format: awk is composed of patterns, actions, or a combination of patterns and actions. The pattern pattern refers to the matching condition, and the action refers to one or more statements in curly braces, separated by commas.

blob.png

3, awk execution process

blob.png

4, area, field

separator.png

5. Record

blob.png

blob.png


blob.png

blob.png

6. Array

blob.png


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324942957&siteId=291194637