i had an unique problem. I have code:
with open("test.csv", "r") as csvFile:
reader = csv.reader(csvFile, skipinitialspace=True)
for row in reader:
for obj in row:
print(obj)
and exemplary csv file:
anotherCommand, e=5, f=6, g=7, h=9, test="aaa, bbb, ggggg"
i want split this string in this way:
anotherCommand
e=5
f=6
g=7
h=9
test="aaa, bbb, ggggg"
but code which i was presented, split these string in this way:
anotherCommand
e=5
f=6
g=7
h=9
test="aaa
bbb
ggggg"
This is wrong solution this problem. I saw topic like: Why is the Python CSV reader ignoring double-quoted fields? or How can i parse a comma delimited string into a list (caveat)?
But this example is different, and these examples not come up my expectation. Someone have idea?