Need help ** removing duplicate rows ** (solution & thanks)

Eric Thompson c60b-3ac at e260-3d.berkeley.edu
Sat Nov 3 05:44:21 AEST 1990


A hearty THANK YOU to everyone who responded.  Just thought I'd let you
know that this is the solution I ended up using:

> From: tslwat!louk (Lou Kates)
> Subject: unique lines except for field 2
> 
> The following command will do it (on some systems you must say nawk
> instead of awk) where x.dat is the data above:
> 
> awk -F: '    { tmp = $0; $2 = ""; store[$0]=tmp; freq[$0]++} 
>          END { for(i in store) if (freq[i]==1) print store[i]}' x.dat

The answers using 'sort' were almost what I needed--but I didn't want to
save ANY occurences of lines that had duplicate information (probably my
fault for not being clear enough).  Again, thanks.  I appreciate it.

Eric Thompson               |  et at ocf.Berkeley.EDU
STONE ROSES & A'S BASEBALL  |  ...!ucbvax!ocf!et



More information about the Comp.unix.questions mailing list