常用AWK命令

左心房为你撑大大i 提交于 2020-03-03 23:32:18

常用AWK命令


Awk is a programming language which allows easy manipulation of structured data and the generation of formatted reports. Awk stands for the names of its authors Aho, Weinberger, and Kernighan.


一、什么是AWK

USAGE:

    Unix:  awk '/pattern/ {print "$1"}'    # standard Unix shells
 DOS/Win:  awk '/pattern/ {print "$1"}'    # okay for DJGPP compiled
           awk "/pattern/ {print \"$1\"}"  # required for Mingw32

二、AWK 查找/Search 与 替换/Substitute

参考:
1、Awk One-Liners Explained, Part II: Text Conversion and Substitution
2、awk cheat sheet

三、AWK编程

REFER:使用AWK去掉重复的单词

參考:


1、The GNU Awk User’s Guide
2、8 Powerful Awk Built-in Variables
3、Awk Introduction Tutorial – 7 Awk Print Examples

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!