当前位置:网站首页>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从入门到入土(7)条件语句
- awk从入门到入土(11)awk getline函数详解
- C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,Gauss-Jordan消去法,源代码
- A method for detecting outliers of data
- 地平线 旭日X3 PI (一)首次开机细节
- Group programming ladder race - exercise set l1-006 continuity factor
- What sparks can applet container technology collide with IOT
- es6总结
- Show server status on Web page (on or off) - PHP
- deno debugger
猜你喜欢
Industry depression has the advantages of industry depression
go-zero微服务实战系列(九、极致优化秒杀性能)
Codeforces Round #803 (Div. 2)(A-D)
Basic operations of databases and tables ----- view data tables
广和通高性能4G/5G无线模组解决方案全面推动高效、低碳智能电网
Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
Démarrage des microservices: passerelle
Display Chinese characters according to numbers
ArcGIS应用(二十二)Arcmap加载激光雷达las格式数据
Mouse over to change the transparency of web page image
随机推荐
根据数字显示中文汉字
C # implements a queue in which everything can be sorted
User login function: simple but difficult
ArcGIS应用(二十二)Arcmap加载激光雷达las格式数据
awk从入门到入土(11)awk getline函数详解
What sparks can applet container technology collide with IOT
Codeforces Round #750 (Div. 2)(A,B,C,D,F1)
Newh3c - routing protocol (RIP, OSPF)
ES6 summary
FRP intranet penetration, reverse proxy
How to get bytes containing null terminators from a string- c#
Codeforces Round #793 (Div. 2)(A-D)
Industry depression has the advantages of industry depression
awk从入门到入土(8)数组
awk从入门到入土(6)正则匹配
Xcode 6 swift code completion does not work properly - Xcode 6 swift code completion not working
How to send pictures to the server in the form of file stream through the upload control of antd
Codeforces Global Round 21(A-E)
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
ctfshow web255 web 256 web257