当前位置:网站首页>Awk from entry to burial (1) awk first meeting
Awk from entry to burial (1) awk first meeting
2022-07-03 02:14:00 【Wonderful binary】
Let's give you one first awk A simple example of , Let's get to know awk The basic structure of the command .
1、 First experience
Let's create a name marks.txt The file of . Including serial number 、 Student name 、 Course name and grades .
1) Amit Physics 80
2) Rahul Maths 90
3) Shyam Biology 87
4) Kedar English 85
5) Hari History 89
Next , We will use AWK Script to display the contents of the output file , At the same time, output header information .
[jerry]$ awk 'BEGIN{printf "Sr No\tName\tSub\tMarks\n"} {print} END{printf "----------------------------\n"}' marks.txt
After executing the above code , The following results will be output :
Sr No Name Sub Marks
1) Amit Physics 80
2) Rahul Maths 90
3) Shyam Biology 87
4) Kedar English 85
5) Hari History 89
----------------------------
Output multiple headers and split lines , Besides, it looks no different from the content of the source file . But this statement describes awk The basic structure of grammar , Let's introduce .
awk 'BEGIN{printf "Sr No\tName\tSub\tMarks\n"} {print} END{printf "---------------
边栏推荐
- Coroutinecontext in kotlin
- SPI机制
- Detailed analysis of micro service component sentinel (hystrix)
- CFdiv2-Fixed Point Guessing-(区间答案二分)
- ByteDance data Lake integration practice based on Hudi
- Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol
- The testing process that software testers should know
- File class (add / delete)
- A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?
- File class (check)
猜你喜欢
[Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor
[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数
【Camera专题】Camera dtsi 完全解析
技术大佬准备就绪,话题C位由你决定
What are MySQL locks and classifications
[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)
Job object of collaboration in kotlin
In 2022, 95% of the three most common misunderstandings in software testing were recruited. Are you that 5%?
LabVIEW安装第三方VISA软件后NI VISA失效
Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol
随机推荐
stm32F407-------ADC
Leetcode 183 Customers who never order (2022.07.02)
CFdiv2-Fixed Point Guessing-(区间答案二分)
Flink CDC mongoDB 使用及Flink sql解析monggo中复杂嵌套JSON数据实现
Cfdiv2 fixed point guessing- (interval answer two points)
Performance test | script template sorting, tool sorting and result analysis
【Camera专题】HAL层-addChannel和startChannel简析
2022 spring "golden three silver four" job hopping prerequisites: Software Test interview questions (with answers)
Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)
Analyzing several common string library functions in C language
Redis: simple use of redis
Cfdiv2 Fixed Point Guessing - (2 points for Interval answer)
DQL basic operation
DML Foundation
SPI机制
线程安全的单例模式
【Camera专题】OTP数据如何保存在自定义节点中
Redis:Redis的简单使用
返回一个树形结构数据
Detailed introduction to the usage of Nacos configuration center