[GLLUG] Merging Records in Input

Steve Parker steve at steve-parker.org
Thu Dec 5 23:26:21 UTC 2013

On 05/12/13 22:38, Mick Farmer wrote:
> Dear GLLUGers,
> I have an input consisting of two fields such as
I thought join, cmp or paste should do it, though this bash script will:

$ cat mick.sh
declare -a mick

while read index value
   mick[$index]="${mick[$index]} $value"
done < mick.txt

for x in ${!mick[@]}
   echo "$x  ${mick[$x]}"

$ ./mick.sh
7   010c 060b
8   003d 003g 005n 008c 010a
9   100c
11   005m 013a
steve at pantera:/tmp$

More information about the GLLUG mailing list