I’m creating a csv file from a python script with this lines:
def createFile():
logfile = csv.writer(open('logfile.csv', 'wb'), dialect='excel')
formater = zip(dates, hours, threadids, loglevels, errorcodes, errormessage)
for i in formater:
logfile.writerow(i)
And everything works fine until I open the file with Excel because it opens the whole text in one column. This is how one row from the csv looks like:
4/29/12,22:44:32:865 EDT,0000004b,A,CHFW0019I,The Transport Channel Service has started chain chain_308.
Is there any way to open the file splitted in columns how it should be?
Regards.
I saved the following in
foo.csvand it opens fine in Excel.You might want to check if you have the right list separator configured in your regional settings using one of the following:
Note that you can also launch ‘Regional and Language Options’ with the command
intl.cpl, i.e. press Windows + R button and enterintl.cpland press the ‘OK’ button.