当前位置:网站首页>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 "---------------
边栏推荐
- Servlet中数据传到JSP页面使用el表达式${}无法显示问题
- Trial setup and use of idea GoLand development tool
- DML Foundation
- Job object of collaboration in kotlin
- leetcode961. Find the elements repeated N times in the array with length 2n
- 4. 类和对象
- Deep learning notes (constantly updating...)
- Missing library while loading shared libraries: libisl so. 15: cannot open shared object file: No such file
- 使用Go语言实现try{}catch{}finally
- Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol
猜你喜欢

线程安全的单例模式

Wechat applet Development Tool Post net:: Err Proxy Connexion Problèmes d'agent défectueux

Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem

Visualisation de l'ensemble de données au format yolov5 (fichier labelme json)

His experience in choosing a startup company or a big Internet company may give you some inspiration

Detailed introduction to the usage of Nacos configuration center

stm32F407-------DMA

PyTorch 卷积网络正则化 DropBlock
![[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)](/img/f1/b17631639cb4f0f58007b86476bcc2.gif)
[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)

Flink CDC mongoDB 使用及Flink sql解析monggo中复杂嵌套JSON数据实现
随机推荐
Groovy, "try with resources" construction alternative
elastic stack
MySQL学习03
力扣(LeetCode)183. 从不订购的客户(2022.07.02)
Method of removing webpage scroll bar and inner and outer margins
Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem
[Yu Yue education] reference materials of chemical experiment safety knowledge of University of science and technology of China
使用Go语言实现try{}catch{}finally
iptables 4层转发
基于线程池的生产者消费者模型(含阻塞队列)
Summary of ES6 filter() array filtering methods
【Camera专题】HAL层-addChannel和startChannel简析
Bottleneck period must see: how can testers who have worked for 3-5 years avoid detours and break through smoothly
Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)
Return a tree structure data
Socket编程
Leetcode(540)——有序数组中的单一元素
What are the key points often asked in the redis interview
File class (check)
[Yu Yue education] China Ocean University job search OMG reference