We have a CSV file. A specific column was to have many entries and those were to be separated with a newline character "\n", which didn't happen. Sample data of the affected column are as follows.
30 units - R135 50 units - R225 80 units - R360
Is there a method to split this into three columns? The number of columns is not fixed. I guess we will have to use many space characters (more than two) to split entries. I need:
data = "that long string"
# Some operation
result = ["30 units - R135", "50 units - R225", "80 units - R360"]
I tried some thing like this. But it didn't work. The result was the same string.
a.split('/(\s){3,}/')
What approach could be taken to split the data?
that long string. Please show real inputs and outputs; people won't try to guess what your data looks like.$1