Error[8]: Undefined offset: 7, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述鉴于下表 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脚本,我想根 鉴于下表
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[]++' file

使用您的数据,输出是:

123456.451 entered-auto_attendant139651.526 entered-auto_attendant139382.537 entered-auto_attendant

并且此行仅打印唯一的column1行:

awk '{a[]++;b[]=
139382.537 entered-auto_attendant
}END{for(x in a)if(a[x]==1)print b[x]}' file

输出:

[+++] 总结

以上是内存溢出为你收集整理的linux – 如何删除基于列值的重复行?全部内容,希望文章能够帮你解决linux – 如何删除基于列值的重复行?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
linux – 如何删除基于列值的重复行?_系统运维_内存溢出

linux – 如何删除基于列值的重复行?

linux – 如何删除基于列值的重复行?,第1张

概述鉴于下表 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脚本,我想根 鉴于下表
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[]++' file

使用您的数据,输出是:

123456.451 entered-auto_attendant139651.526 entered-auto_attendant139382.537 entered-auto_attendant

并且此行仅打印唯一的column1行:

awk '{a[]++;b[]=
139382.537 entered-auto_attendant
}END{for(x in a)if(a[x]==1)print b[x]}' file

输出:

总结

以上是内存溢出为你收集整理的linux – 如何删除基于列值的重复行?全部内容,希望文章能够帮你解决linux – 如何删除基于列值的重复行?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1047389.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存