Hi,
I have a file where there "Tab" seperated values are present.I need to identify duplicate entries based on column 1 & 6 only .
For e.g :
I tried using uniq ..but the output is only having one duplicate entry, instead of both the entries.I need both the above entries .
uniq -f5 -d file1
Output :
555002160 120203 230613 120204 390 T04DM
$ sort -t" " -k6 file | uniq -f5 -D
555002160 120203 230611 120204 390 T04DM
555002160 120203 230613 120204 392 T04DM
Guru.
Thanks Guru...still i was having problems with the sort suggested by you, as the columns in my file were bit more complicated.I just gave an example .
Thanks for ur time.
I managed to crack it using awk...
awk -F"|" '{if (x[$1$6]) { x_count[$1$6]++; print $0; if (x_count[$1$6] == 1) { print x[$1$6] } } x[$1$6] = $0}' file1
---------- Post updated at 06:07 PM ---------- Previous update was at 06:06 PM ----------
Forgot to mention...i modified the delimiter to "|" instead of tab.