当前位置:网站首页>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 &
边栏推荐
- 一文了解數據异常值檢測方法
- Educational Codeforces Round 119 (Rated for Div. 2)
- How to choose solid state hard disk and mechanical hard disk in computer
- Need help resetting PHP counters - PHP
- 埃氏筛+欧拉筛+区间筛
- 小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
- 广和通高性能4G/5G无线模组解决方案全面推动高效、低碳智能电网
- awk从入土到入门(10)awk内置函数
- Codeforces Round #793 (Div. 2)(A-D)
- Snipaste convenient screenshot software, which can be copied on the screen
猜你喜欢

DM8 database recovery based on point in time

Fault analysis | MySQL: unique key constraint failure

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

Collections in Scala

Mouse over to change the transparency of web page image

What if the wireless network connection of the laptop is unavailable

How does Xiaobai buy a suitable notebook

What sparks can applet container technology collide with IOT

Codeforces Global Round 21(A-E)

09 softmax regression + loss function
随机推荐
FRP intranet penetration, reverse proxy
2022 tower crane driver examination and tower crane driver examination questions and analysis
Fault analysis | MySQL: unique key constraint failure
AI Winter Olympics | is the future coming? Enter the entrance of the meta universe - virtual digital human
Cancel ctrl+alt+delete when starting up
awk从入门到入土(9)循环语句
[error record] no matching function for call to 'cacheflush' cacheflush();)
MySQL relearn 1-centos install mysql5.7
NewH3C——ACL
没有Kubernetes怎么玩Dapr?
【无标题】转发最小二乘法
What should I do if there is a problem with the graphics card screen on the computer
09 softmax regression + loss function
C, Numerical Recipes in C, solution of linear algebraic equations, Gauss Jordan elimination method, source code
deno debugger
The second session of the question swiping and punching activity -- solving the switching problem with recursion as the background (I)
如何通过antd的upload控件,将图片以文件流的形式发送给服务器
Industry depression has the advantages of industry depression
manjaro安装微信
Démarrage des microservices: passerelle