gpt4 book ai didi

shell - AWK 脚本 :How to remove Field separator using awk

转载 作者:行者123 更新时间:2023-12-01 07:31:38 28 4
gpt4 key购买 nike

需要以下输出

ONGC044 
ONGC043
ONGC042
ONGC041
ONGC046
ONGC047

从这个输入
Medium Label                   Medium ID                            Free Blocks
===============================================================================
[ONGC044] ECCPRDDB_FS_43 ac100076:4aed9b39:44f0:0001 195311616
[ONGC043] ECCPRDDB_FS_42 ac100076:4aed9b1d:44e8:0001 195311616
[ONGC042] ECCPRDDB_FS_41 ac100076:4aed9af4:4469:0001 195311616
[ONGC041] ECCPRDDB_FS_40 ac100076:4aed9ad3:445e:0001 195311616
[ONGC046] ECCPRDDB_FS_44 ac100076:4aedd04a:68c6:0001 195311616
[ONGC047] ECCPRDDB_FS_45 ac100076:4aedd4a0:6bf5:0001 195311616

最佳答案

awk -F"[][]" 'NR>2{print $2}' file

关于shell - AWK 脚本 :How to remove Field separator using awk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2957645/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com