Quantcast
Channel: Find and print lines that have duplicate column value - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Ed Morton for Find and print lines that have duplicate column value

$ awk 'cnt[$2]++{if (cnt[$2]==2) print prev[$2]; print} {prev[$2]=$0}' file15:14:59 00013458771 0.0104720592499 0.000365018844604 0.00027298927307115:01:13 00013458771 0.0059118270874 0.000330924987793...

View Article



Find and print lines that have duplicate column value

I am looking for a one liner that can find and print the lines (from original file) which have multiple occurrences of a column value. The file looks like:14:33:48 00039410636 0.0712261199951...

View Article
Browsing latest articles
Browse All 2 View Live


Latest Images