CSV File - Multiple rows to one row

  • Thread starter Thread starter phi16181
  • Start date Start date
P

phi16181

So I have been working with a csv export for a few days now and I have the data almost in the form I need it in. I need some advice on how best to proceed to get to the solution I need.

Here is the problem:

My csv export contains multiple rows (over 2000) of data in this format:

Code:
data1,data2,data3,data4
data1,data2,data3,data4
data1,data2,data3,data4
and I need to convert groups of three rows into one single line like this:

Code:
data1,data2,data3,data4,data1,data2,data3,data4,data1,data2,data3,data4
It looks like Bash and Python might be options for doing this.

Any thoughts on how you might handle this would be greatly appreciated.

Continue reading...
 
Back
Top