Hi guys!
I’m currently working with a python csv module and trying to use a ‘|’ delimiter. From what i understand the delimiter is a characted that seperates the values of each column of a table.
What i don’t understand is why python keeps putting ‘;’ between the values of each column, not a ‘|’ after i’ve set the deliminator? Here’s an example
# Suppose i have an excel table 'example' saved as a .csv file containing a simple table like this:
# Cat | Mouse | Dog
>>> ifile = open('example.csv', 'r')
>>> reader = csv.reader(ifile, delimiter = '|')
>>> reader.next()
['Cat;Mouse;Dog'] # But shouldn't it be ['Cat|Mouse|Dog'] !?
As you can see, each column is seperated by a semicolon, but shouldn’t it now use ‘|’ as a column seperator when i changed the delimiter to ‘|’?
Thank you very much!
Does this work: