[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [MacPerl] Merging elements



I ended up using Ronald's suggestion (Thanks Ronald!) which oddly enough is
something I've used before, but somehow forgot about... 

Anyway, this did exactly what I wanted, so the boss will get his reports on
time, thanks to MacPerl and the MacPerl mailing list... ;)

(and I did it all with a single button mouse!)

Pete

> ----------
> From: 	Ronald J Kimball
> 
> Would a simple hash be sufficient?
> 
> while (<>) {
>   chomp;
>   ($key, $data) = split;
>   $data{$key} .= ',' if defined $data{$key};
>   $data{$key} .= $data;
> }
> 
> foreach $key (sort keys %data) {
>   print "  $key  $data{$key}\n";
> }
> 
> 

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org