[GLLUG] Merging Records in Input

Carles Pina i Estany carles at pina.cat
Thu Dec 5 23:12:38 UTC 2013


Hi,

On Dec/05/2013, Mick Farmer wrote:

> I have an input consisting of two fields such as
> 
> ...
> 7 010c
> 7 060b
> 8 003d
> 8 003g
> 8 005n
> 8 008c
> 8 010a
> 9 100c
> 11 005m
> 11 013a
> ...
> 
> which I want to merge on the first field (key) as follows
> 
> ...
> 7 010c 060b
> 8 003d 003g 005n 008c 010a
> 9 100c
> 11 005m 013m
> ...
> 
> I'm sure there's a UNIX utility that does this (sort?, uniq?) but can't
> currently find it.  Can anyone help?

I thought of 'join'. It's doing something similar but the input should
be from different files.

Anyone else? :-)

-- 
Carles Pina i Estany
	Web: http://pinux.info || Blog: http://pintant.cat




More information about the GLLUG mailing list