Re: Group and concatenate

2002-10-06 Thread James Edward Gray II
On Sunday, October 6, 2002, at 03:47 AM, John W. Krahn wrote: > $ perl -pe 's/^(\d+\s+)([a-zA-Z]+)\s+([a-zA-Z]+)$/$1$2;$3/' infile > 222xxx;J > 222www;DD > 222cc;ffFFF > 909eee; > 909FFF; > 909j; > 888JJJ; > 888HHH; > > > This _will_ wo

Re: Group and concatenate

2002-10-06 Thread Paul Johnson
On Sat, Oct 05, 2002 at 10:32:55PM -0400, Paul Van Dalen wrote: > Actually, Paul J., I thought the whole point of this board was to enhance > one's knowledge. Good. That's what I thought too. > Sure, I could probably get it done with the very limited > knowledge I have in a v

Re: Group and concatenate

2002-10-06 Thread ANIDIL RAJENDRAN
Paul, Try this. it is pretty easy while () { print "$1 $2;$3\n" if $_ =~ /^(\d+)\s+(\w+)\s+(\w+)$/; } __DATA__ 222xxxJ 222wwwDD 222ccffFFF 909eee 909FFF 909j 888JJJ 888HHH Anidil Patinatiyil Rajend

Re: Group and concatenate

2002-10-06 Thread Paul Van Dalen
Actually, Paul J., I thought the whole point of this board was to enhance one's knowledge. Sure, I could probably get it done with the very limited knowledge I have in a very convaluted fashion, but I suspected there was a much easier way to do it. But thanks for your concern. Peckerhead. "Pa

Re: Group and concatenate

2002-10-06 Thread John W. Krahn
James Edward Gray II wrote: > > On Saturday, October 5, 2002, at 06:02 PM, Paul Van Dalen wrote: > > > > Given this input: > > > > 222xxxJ > > 222wwwDD > > 222ccffFFF > > 909eee > > 909FFF > > 909j > > 888JJJ > > 888

Re: Group and concatenate

2002-10-05 Thread James Edward Gray II
perl -pe 's/^(\d+\s+)([a-zA-Z]+)\s+([a-zA-Z]+)$/$1$2;$3/' infile >outfile On Saturday, October 5, 2002, at 06:02 PM, Paul Van Dalen wrote: > Hi Gang, > > Given this input: > > 222xxxJ > 222wwwDD > 222ccffFFF > 909eee > 909FFF > 909j

Re: Group and concatenate

2002-10-05 Thread Paul Johnson
On Sat, Oct 05, 2002 at 07:02:09PM -0400, Paul Van Dalen wrote: > Hi Gang, > > Given this input: > > 222xxxJ > 222wwwDD > 222ccffFFF > 909eee > 909FFF > 909j > 888JJJ > 888HHH > > I'd like to split the

Group and concatenate

2002-10-05 Thread Paul Van Dalen
Hi Gang, Given this input: 222xxxJ 222wwwDD 222ccffFFF 909eee 909FFF 909j 888JJJ 888HHH I'd like to split the input, group it by the first column, and, for that group, print out a concatenated second col