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 1 > A 2 > A 3 > B 1 > C 2 > D 3 > D 4 > The result should be > > A 1|2|3 > B 1 > C 2 > D 3|4 > > What should I do to get my results > > Looking at the answer u require , u can clearly make a dictionary if list datastructure! where dictionary keys are A,B, C ,D and corresponding values are list if items (ie., 1,2,3 ...) Once u have such a dict loaded, its kust a matter of accessing that list via a key and display it joined! HTH KM > > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list