当前位置:网站首页>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 &
边栏推荐
- Sort by item from the list within the list - C #
- User login function: simple but difficult
- System disk expansion in virtual machine
- PHP session variable passed from form - PHP
- Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
- Take you to master the formatter of visual studio code
- 随机事件的关系与运算
- How to solve the problem that computers often flash
- NewH3C——ACL
- Manjaro install wechat
猜你喜欢

Bishi blog (13) -- oral arithmetic test app

A method for detecting outliers of data

Démarrage des microservices: passerelle

User login function: simple but difficult

go-zero微服务实战系列(九、极致优化秒杀性能)

Codeforces Round #793 (Div. 2)(A-D)

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

Turn: excellent managers focus not on mistakes, but on advantages

根据数字显示中文汉字

ArcGIS application (XXII) ArcMap loading lidar Las format data
随机推荐
How college students choose suitable computers
Openfeign service interface call
Cancel ctrl+alt+delete when starting up
Use preg_ Match extracts the string into the array between: & | people PHP
AcWing 244. Enigmatic cow (tree array + binary search)
Call Baidu map to display the current position
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
How to get bytes containing null terminators from a string- c#
如何通过antd的upload控件,将图片以文件流的形式发送给服务器
Show server status on Web page (on or off) - PHP
How to play dapr without kubernetes?
deno debugger
Convert datetime string to datetime - C in the original time zone
PHP session variable passed from form - PHP
What sparks can applet container technology collide with IOT
SQL statement view SQL Server 2005 version number
Newh3c - routing protocol (RIP, OSPF)
ctfshow web255 web 256 web257
Redis sentinel mechanism
Need help resetting PHP counters - PHP