鉴于下表
123456.451 entered-auto_attendant 123456.451 duration:76 real:76 139651.526 entered-auto_attendant 139651.526 duration:62 real:62` 139382.537 entered-auto_attendant
使用基于Linux的bash shell脚本,我想根据第1列(具有长号的那个)的值删除所有行.考虑到这个数字是一个可变数字
我试过了
awk'{a [$3]}!(一个[$3] -1)’文件
sort -u | uniq
但是我没有得到类似这样的结果,在第一列的所有值之间进行比较,删除所有重复项并显示它
123456.451 entered-auto_attendant 139651.526 entered-auto_attendant 139382.537 entered-auto_attendant
解决方法
你没有给出预期的输出,这对你有用吗?
awk '!a[$1]++' file
使用您的数据,输出是:
123456.451 entered-auto_attendant 139651.526 entered-auto_attendant 139382.537 entered-auto_attendant
并且此行仅打印唯一的column1行:
awk '{a[$1]++;b[$1]=$0}END{for(x in a)if(a[x]==1)print b[x]}' file
输出:
139382.537 entered-auto_attendant
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。