I have a small issue while trying to parse some data from a table. My program reads a row of the table and then puts it in a list as a string (Python does this as default with a reader.next() function). Everything is fine until there aren't any commas separating some text on the same table space. In this case, the program thinks the comma is a separator and makes 2 list indexes instead of one, and this makes things like list[0].split(';') impossible.
I suck at explaining verbally, so let me illustrate:
csv_file = | House floors | Wooden, metal and golden | 2000 | # Illustration of an excel table
reader = csv.reader(open('csv_file.csv', 'r'))
row = reader.next() # row: ['House floors;Wooden', 'metal and golden; 2000']
columns = row.split(';') # columns: ['House floors, Wooden', 'metal and golden', '2000']
# But obviously what i want is this:
# columns : ['House floors', 'Wooden, metal and golden', '2000']
Thank you very much for your help!