![]() |
CSV Reader - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: CSV Reader (/thread-3376.html) |
CSV Reader - soundcw - May-18-2017 Hi I am a new programmer with Python and do appreciate any help or suggestions - a virtual beer is offered :) I am running my program and get this error - My code is with open(prodfile, "r") as f_product: reader = csv.reader(f_product,delimiter=',') for row in reader: prod_list.append(row[0]) # we now have a Product list stored TAG prod_1.append(row[2]) # we now have a Mono Cube list stored LONG DESCRIPTION prod_2.append(row[4]) # we now have a Mono Cube list stored PARENT TAG prod_3.append(row[6]) # we now have a Mono Cube list stored HIER NAME prod_4.append(row[7]) # we now have a Mono Cube list stored HIER LEVEL NUMBER prod_5.append(row[8]) # we now have a Mono Cube list stored HIER LEVEL NAME prodcount = prodcount + 1 s.add(row[0]) # create a setI see in my data I have a Tilda char ~~~~~~~~~~~~~ so i think this may be the issue but i am not sure -any help is appreciated and im on PYTHON 3.5.3 Regards Chris RE: CSV Reader - snippsat - May-18-2017 Try: with open(prodfile, "r") as f_product: # To with open(prodfile, encoding='utf-8') as f_product: |