当前位置:网站首页>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 &
边栏推荐
- Comparison between sentinel and hystrix
- How to use C language code to realize the addition and subtraction of complex numbers and output structure
- deno debugger
- What sparks can applet container technology collide with IOT
- 2022 gas examination registration and free gas examination questions
- awk从入门到入土(14)awk输出重定向
- Display Chinese characters according to numbers
- System disk expansion in virtual machine
- std::is_ union,std::is_ class,std::integral_ constant
- Codeforces Round #793 (Div. 2)(A-D)
猜你喜欢
随机推荐
Learn nuxt js
Redis 哨兵机制
Flutter integrated amap_ flutter_ location
How to send pictures to the server in the form of file stream through the upload control of antd
SQL statement view SQL Server 2005 version number
Basic operations of databases and tables ----- view data tables
Conversion of yolov5 XML dataset to VOC dataset
awk从入门到入土(8)数组
How college students choose suitable computers
What does range mean in PHP
Codeforces Round #793 (Div. 2)(A-D)
C, Numerical Recipes in C, solution of linear algebraic equations, Gauss Jordan elimination method, source code
Comprendre la méthode de détection des valeurs aberrantes des données
manjaro安装微信
PHP session variable passed from form - PHP
es6总结
The upper layer route cannot Ping the lower layer route
1. Getting started with QT
Codeforces Round #793 (Div. 2)(A-D)
Codeforces Global Round 21(A-E)