Paul,
Try this. it is pretty easy
while (<DATA>) {
print "$1 $2;$3\n" if $_ =~ /^(\d+)\s+(\w+)\s+(\w+)$/;
}
__DATA__
222 xxx JJJJJ
222 www DD
222 cc ffFFF
909 eee EEEE
909 FFF kkkk
909 jjjjj KKKK
888 JJJ HHHH
888 HHH JJJJ
Anidil Patinatiyil Rajendran
Burlingame,California
650 730 8271
> On Sat, Oct 05, 2002 at 07:02:09PM -0400, Paul Van Dalen wrote:
>
> > Hi Gang,
> >
> > Given this input:
> >
> > 222 xxx JJJJJ
> > 222 www DD
> > 222 cc ffFFF
> > 909 eee EEEE
> > 909 FFF kkkk
> > 909 jjjjj KKKK
> > 888 JJJ HHHH
> > 888 HHH JJJJ
> >
> > I'd like to split the input, group it by the first column, and, for that
> > group, print out a concatenated second column. The output should look
> > thusly:
> >
> > 222 xxx;www;cc
> > 909 eee;FFF;jjjjj
> > 888 JJJ;HHH
> >
> > Many thanks,
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]