当前位置:网站首页>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 "---------------
边栏推荐
- 通达OA 首页门户工作台
- 单词单词单词
- es6 filter() 数组过滤方法总结
- String replace space
- 疫情當頭,作為Leader如何進行團隊的管理?| 社區征文
- Analysis, use and extension of open source API gateway apisex
- In 2022, 95% of the three most common misunderstandings in software testing were recruited. Are you that 5%?
- Wechat applet Development Tool Post net:: Err Proxy Connexion Problèmes d'agent défectueux
- Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
- 返回一个树形结构数据
猜你喜欢
随机推荐
Kotlin middle process understanding and Practice (I)
Query product cases - page rendering data
easyPOI
转载收录6.5大侠写的部分Qt开发经验
Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol
Recommendation letter of "listing situation" -- courage is the most valuable
Unrecognized SSL message, plaintext connection?
[shutter] shutter debugging (debugging fallback function | debug method of viewing variables in debugging | console information)
es6 filter() 数组过滤方法总结
RestCloud ETL 跨库数据聚合运算
Asian Games countdown! AI target detection helps host the Asian Games!
Hard core observation 547 large neural network may be beginning to become aware?
stm32F407-------IIC通讯协议
Ni visa fails after LabVIEW installs the third-party visa software
Solution for processing overtime orders (Overtime unpaid)
苏世民:25条工作和生活原则
详细些介绍如何通过MQTT协议和华为云物联网进行通信
詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信
Groovy, "try with resources" construction alternative
stm32F407-------DMA









