AWK Notes
来源:互联网 发布:js当前时间加一年 编辑:程序博客网 时间:2024/04/30 06:01
#print the x field of the y line:
awk 'FNR == "'$y'" {print $"'$x'"}' file
[asicer@localhost ~]$ var=item1; printf "item1\t\t4\nitem2\t\t8\nitem3\t\t7\n" | awk -v value=$var '{
if ($1==value)
{$2=$2+1; printf "%s\t\t%s\n", $1, $2}
else
{print}
}'
item1 5
item2 8
item3 7
- AWK Notes
- Awk notes
- AWK NOTES
- Notes
- notes
- Notes
- notes
- notes
- notes
- notes
- Notes
- notes
- Notes
- notes
- Notes
- notes
- Notes
- Notes
- .net缩略图 GDI+一般性错误解决方法。
- Android屏幕大小和密度对照表,以及px、dip、sp等像素单位的解释
- C# Dlllmport 学习
- Map 控件深入学习
- (转载)Windows PowerShell 講座 (1)—指令、重導、別名
- AWK Notes
- Java compiler level does not match the version of the installed Java project fac
- zoj 3321 Circle (4)
- (转载)Windows PowerShell 講座 (2)—自訂工作環境
- 计算机图形学国际知名会议与期刊
- 推送通知
- JAVA调用DLL的两种方法(作者不详,如有冒犯请速联系我,我只是用来参考)
- Linux环境编程--fflush(stdout)有什么作用
- (转载) Windows PowerShell ---流程控制