Re: joining rows

2007-12-29 Thread Tim Chase
> on a second read ... I see that you mean the case that should only > join consecutive lines with the same key Yes...there are actually three cases that occur to me: 1) don't care about order, but want one row for each key (1st value) 2) do care about order, and don't want disjoint runs of dupl

Re: joining rows

2007-12-29 Thread Istvan Albert
on a second read ... I see that you mean the case that should only join consecutive lines with the same key -- http://mail.python.org/mailman/listinfo/python-list

Re: joining rows

2007-12-29 Thread Istvan Albert
On Dec 29, 10:22 am, Tim Chase <[EMAIL PROTECTED]> wrote: > If, however, order matters, you have to do it in a slightly > buffered manner. > Can be reduced to a sed one-liner I think the original version works just as well for both cases. Your sed version however does need the order you mention.

Re: joining rows

2007-12-29 Thread Tim Chase
> A1 > A2 > A3 > B1 > C 2 > D 3 > D 4 > The result should be > > A1|2|3 > B1 > C2 > D3|4 > > What should I do to get my results Well, it depends on whether the resulting order matters. If not,

Re: joining rows

2007-12-29 Thread km
Hi On Dec 29, 2007 3:08 PM, Beema shafreen <[EMAIL PROTECTED]> wrote: > hi every body, > > I have two columns in a file separted by tabs > > If the column1 is common in the row1 and row2 then it should be column > 2 should be displayed in the single line. > eg: > col 1 col2 > A

joining rows

2007-12-29 Thread Beema shafreen
hi every body, I have two columns in a file separted by tabs If the column1 is common in the row1 and row2 then it should be column 2 should be displayed in the single line. eg: col 1 col2 A1 A2 A3 B1 C 2 D 3