从列中提取子字符串,并使用 bash 添加新列
抱歉,如果是重新发布。
我的数据(在选项卡中的划界文本文件中):
Number Description
1 YR=2020 Country=country_A ID=QWE
2 YR=2020 ID=ASD
3 YR=2019 Country=country_B ID=ZXC
4 Country=country_C ID=POI
我想使用bash从Description> Description
列提取信息。
所需的输出:
Number YR ID
1 2020 QWE
2 2020 ASD
3 2019 ZXC
4 - POI
Sorry if it is a repost.
My data (in a tab delimited text file):
Number Description
1 YR=2020 Country=country_A ID=QWE
2 YR=2020 ID=ASD
3 YR=2019 Country=country_B ID=ZXC
4 Country=country_C ID=POI
I would like to extract the information from the description
column using bash.
Desired output:
Number YR ID
1 2020 QWE
2 2020 ASD
3 2019 ZXC
4 - POI
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个
awk
想法:注意:删除
# comments ...
以整理代码这会生成:
One
awk
idea:NOTE: remove
# comments ...
to declutter codeThis generates: