5

Find the replicate record using awk

view full story
linux-howto

http://www.unix.com – We usually use the following awk code to delete of find out the replicate record. Code: awk -F, '{a[$1]++} END {for (i in a) if (a[i]>=2) print i a[i]}' file My question is how can I print the whole record. The following code doesn't work. Code: awk -F, '{a[$1]++} END {for (i in a) if (a[i]>=2) print $0}' file Thank you! (HowTos)