当前位置:网站首页>Awk from entry to soil (5) simple condition matching
Awk from entry to soil (5) simple condition matching
2022-07-04 08:46:00 【Wonderful binary】
We have been talking about ,awk The usage syntax of is as follows ( I think you are already familiar with ):
awk [options] ‘pattern {Action}’ file1 file2 ···
about options( Options ) for , We used it -F Options , Also used -v Options .
about Action( action ) for , We used it print And printf, Later in the article , We will also be right Action Summarize .
about Pattern( Pattern ) for , We are just beginning to learn awk when , Two special modes are introduced ,BEGIN Patterns and END Pattern , however , We don't have a detailed introduction ” Pattern ” What is it? , How to use it? , And here , We will introduce in detail awk The pattern in .
“ Pattern ” This word sounds very literary , It's not particularly easy to understand , Let's put it another way , We put ” Pattern ” Switch to ” Conditions ”, Maybe easier to understand , that ” Conditions ” What does that mean ? We know ,awk It processes text line by line , in other words ,awk Will deal with the current line first , Process the next line , If we don't specify any ” Conditions ”,awk Each line in the text will be processed line by line , If we specify ” Conditions ”, Only satisfaction ” Conditions ” The row will be processed , dissatisfaction ” Conditions ” The row will not be processed . Is that a little easier to understand than just now ? This is actually awk Medium ” Pattern ”.
Again , When awk When processing line by line , Will be able to pattern( Pattern ) As a condition , Judge whether the row to be processed meets the conditions , Can you follow ” Pattern ” Match , If the match , Then deal with , If it doesn't match , Do not deal with .
Take a small example &
边栏推荐
- Learn nuxt js
- DM8 command line installation and database creation
- 2022 examination questions for safety managers of metal and nonmetal mines (underground mines) and examination papers for safety managers of metal and nonmetal mines (underground mines)
- A method for detecting outliers of data
- Convert datetime string to datetime - C in the original time zone
- Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
- Educational Codeforces Round 119 (Rated for Div. 2)
- AcWing 244. Enigmatic cow (tree array + binary search)
- Li Kou today's question -1200 Minimum absolute difference
- 没有Kubernetes怎么玩Dapr?
猜你喜欢

Four essential material websites for we media people to help you easily create popular models

Codeforces Round #750 (Div. 2)(A,B,C,D,F1)

L1 regularization and L2 regularization
![[CV] Wu Enda machine learning course notes | Chapter 9](/img/de/41244904c8853b8bb694e05f430156.jpg)
[CV] Wu Enda machine learning course notes | Chapter 9

Codeforces Global Round 21(A-E)

Openfeign service interface call

System disk expansion in virtual machine

FOC control

How can we make a monthly income of more than 10000? We media people with low income come and have a look

Basic operations of databases and tables ----- view data tables
随机推荐
awk从入门到入土(5)简单条件匹配
2022 gas examination registration and free gas examination questions
FOC控制
How to play dapr without kubernetes?
Leetcode topic [array] -136- numbers that appear only once
AI Winter Olympics | is the future coming? Enter the entrance of the meta universe - virtual digital human
yolov5 xml数据集转换为VOC数据集
Unity write word
Basic operations of databases and tables ----- view data tables
How college students choose suitable computers
Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
Add log file to slim frame - PHP
Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
Developers really review CSDN question and answer function, and there are many improvements~
Educational Codeforces Round 119 (Rated for Div. 2)
Four essential material websites for we media people to help you easily create popular models
awk从入土到入门(10)awk内置函数
Cancel ctrl+alt+delete when starting up
团体程序设计天梯赛-练习集 L2-002 链表去重
How to send pictures to the server in the form of file stream through the upload control of antd