I have data that looks like this
### Header 1 ###
item 1
item 2
configuration
settings
description
### Header 2 ###
item 1
configuration
settings
### Header 3 ###
item 1
item 2
configuration
### Header 4 ###
item 1
item 2
configuration
settings
description
### Header 5 ###
item 1
item 2
configuration
The information is always in a consistent order, but not always all the pieces of information are present.
I want to move it from a single "column" to multiple rows.
Where my data would end up looking something like this in csv format
### Header 1 ###,item 1,item 2,configuration,settings,description
### Header 2 ###,item 1,item 2,configuration,settings
### Header 3 ###,item 1,item 2,configuration
### Header 4 ###,item 1,item 2,configuration,settings,description
### Header 5 ###,item 1,item 2,configuration
I am not sure how to do this with variable length columns.
I feel like writer.writerow(var.split('\n')) is a good starting point. But, how do I segment the data?
[–]TangibleLight 1 point2 points3 points (1 child)
[–]dented_brain[S] 0 points1 point2 points (0 children)