更改AWK读取文件的方式 [英] Change the way AWK read file
本文介绍了更改AWK读取文件的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以帮助我实现这个目标,通常AWK读取文件
anyone could help me to achieve this ,normally AWK read file
a b c
为
$1:a
$2:b
$3:c
如何读取该文件
a
b
c
为
$1:a
$2:b
$3:c
寻求帮助非常感谢。
Many thanks for help .
推荐答案
您可以不设置记录分隔,改变输入分隔符的换行符:
You can unset the Record Separator and change the Input Field Separator to the newline character:
$ awk -F'\n' -vRS='' '{print $1,$2,$3}' file
a b c
这篇关于更改AWK读取文件的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文