OK major example update needed.
I have exactly this: Joining all rows of a CSV file that have the same 1st column value in Python (first I must appologize for not getting how to just raise the tread again...)
I have a x.CSV file that goes like this: INT;INT2;STRING;STRING;STRING;STRING;STRING;STRING;STRING;STRING;STRING;and_so_on......
0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1.0;0;0;-1;-1.0
0;0;;;;;;;;;;;;;30.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;160.0;;;;;;;;;;;;;;;;;;;;;;
0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.0;;;;;;;;;;;;;;;;;;;;
0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.0;;;;;;;;;;;;;;;;;;;
0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1668.0;;;;;;;;;;;;;;;;;;;;;;;;;
0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1672.0;;;;;;;;;;;;;;;;;;;;;;;;
0;0;;;;;;;;;;;;;;;;;;0.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
0;0;;;;;;;;;;;;;;;;;;;74.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.0;;;;;;;;;;;;
1;1;0.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3;3;4.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3;3;;;;;;;;;;;;;;;;;;;;;;;;;75.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5;5;0.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5;5;;;;;;;;;;;;;;;;;;;;;;;;;85.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Now, I need a way to join all of the rows that have the same 1st column name into one column, for example:
INT;INT2;STRING;STRING;STRING;STRING;STRING;STRING;STRING;STRING;STRING;and_so_on......
0;0;;;;;;;;;;;;;30.0;;;;;0.0;74.0;;;;;;;;;;;;;;;;1668.0;1672.0;;;160.0;;;;;0.0;0.0;;;;;;;;;;;;;;-1.0;0;0;-1;-1.0
1;1;0.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.0;;;;;;;;;;;;
3;3;4.0;;;;;;;;;;;;;;;;;;;;;;;;75.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5;5;0.0;;;;;;;;;;;;;;;;;;;;;;;;85.0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
It is the same number of colums (even though "resultrow" 0;0.... might have too many ";" since i faked it ;-) numbers only turn up once in the same indexrow, so it's kind of a "merge the same indexrow" I need something that reads the >20k (it can be >1million as well) rows long file. Compresses the list And writes the file back to disk again.
Helpers only tip in what direction to code and I'm not able to :-/ (yet... :-) With the greatest respect - I don't code blush - I can read it but not design it. Me posting code would be - lets say amusing :-)
I would very much appriciate the help. br //