输入包含由逗号(,)隔开的多个字段(字段值非空),请将第三个字段替换为42$ echo 'lion,ant,road,neon' | awk '____________________'lion,ant,42,neon
查看答案
将输入行中倒数第4个so替换为X,仅打印被替换的行$ printf 'so and so also sow and soup' | awk '____________________'so and X also sow and soup
把每个单词用()括起来,并删除单词imp和ant$ echo 'tiger imp goat eagle ant important' | awk '____________________'(tiger) () (goat) (eagle) () (important)
抽取每行中在()或)(之间的内容,假定每行中字符(和)仅出现一次$ cat brackets.txtfoo blah blah(ice) 123 xyz$(almond-pista) chocoyo )yoyo( yo$ awk ____________________ brackets.txticealmond-pistayoyo
按要求格式抽取文件scores.csv的姓名和物理成绩$ cat scores.csvName,Maths,Physics,ChemistryBlue,67,46,99Lin,78,83,80Er,56,79,92Cy,97,98,95Ort,68,72,66Ith,100,100,100$ awk ____________________ scores.csvName:PhysicsBlue:46Lin:83Er:79Cy:98Ort:72Ith:100