Duplicate Lines x 4

Hi Guys and Girls

I'm having trouble outputing from a sorted file... i have a looooong list of PVIDs and need to only output only those which occur 4 times!! Any suggestions?

ie I need to uniq (but not uniq (i've been through the man pg) this:

cat /tmp/disk.out|awk '{print $3}' |grep -v PVID|sort -d -f -n|?????

Cheers for now

Can you explain more by giving an example of input and the output you want!

nawk '{arr[$3]++} END { for( i in arr ) if (arr == 4) print i}' /tmp/disk.out

superv solution!!

Works perfectly !! Many thanks!!

I think i can work out what its doing as well, exept the "++" - what does that do?

increments the preceeding variable by 1

simple.... :wink: It's incrementing the instances of $3