当前位置:网站首页>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 &
边栏推荐
- awk从入门到入土(5)简单条件匹配
- 2022 gas examination registration and free gas examination questions
- DM database password policy and login restriction settings
- Laravel page load problem connection reset - PHP
- How to use C language code to realize the addition and subtraction of complex numbers and output structure
- What if I forget the router password
- Openfeign service interface call
- [untitled] 2022 polymerization process analysis and polymerization process simulation examination
- @Role of requestparam annotation
- Developers really review CSDN question and answer function, and there are many improvements~
猜你喜欢

Redis sentinel mechanism
![Sports [running 01] a programmer's half horse challenge: preparation before running + adjustment during running + recovery after running (experience sharing)](/img/c8/39c394ca66348044834eb54c68c2a7.png)
Sports [running 01] a programmer's half horse challenge: preparation before running + adjustment during running + recovery after running (experience sharing)

Bishi blog (13) -- oral arithmetic test app

一文了解数据异常值检测方法

Démarrage des microservices: passerelle

Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service

AcWing 244. Enigmatic cow (tree array + binary search)

转:优秀的管理者,关注的不是错误,而是优势

ArcGIS应用(二十二)Arcmap加载激光雷达las格式数据

Four essential material websites for we media people to help you easily create popular models
随机推荐
没有Kubernetes怎么玩Dapr?
Comprendre la méthode de détection des valeurs aberrantes des données
High order phase difference such as smear caused by myopic surgery
Démarrage des microservices: passerelle
2022 electrician (intermediate) examination question bank and electrician (intermediate) examination questions and analysis
FOC control
Comparison between sentinel and hystrix
2022 gas examination registration and free gas examination questions
Fault analysis | MySQL: unique key constraint failure
Group programming ladder race - exercise set l2-002 linked list de duplication
Conversion of yolov5 XML dataset to VOC dataset
Convert datetime string to datetime - C in the original time zone
AcWing 244. Enigmatic cow (tree array + binary search)
How to re enable local connection when the network of laptop is disabled
ctfshow web255 web 256 web257
WordPress get_ Users() returns all users with comparison queries - PHP
Difference between static method and non static method (advantages / disadvantages)
2022 tower crane driver examination and tower crane driver examination questions and analysis
Collections in Scala
Sort by item from the list within the list - C #