By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,818 Members | 1,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,818 IT Pros & Developers. It's quick & easy.

Converting a xls file into csv file using Python

P: 14
Hello,

I m trying to convert a xls file data into csv type data.

Is it possible anyway that i can do this using python coding

if yes than plz provide a demo code for this

Thanks
May 24 '07 #1
Share this Question
Share on Google+
7 Replies


Expert 100+
P: 511
Hello,

I m trying to convert a xls file data into csv type data.

Is it possible anyway that i can do this using python coding

if yes than plz provide a demo code for this

Thanks
there are modules you can download, eg pyexcelerator that can do simple excel manipulations. See its docs for more examples.
May 24 '07 #2

bartonc
Expert 5K+
P: 6,596
Hello,

I m trying to convert a xls file data into csv type data.

Is it possible anyway that i can do this using python coding

if yes than plz provide a demo code for this

Thanks
If you know enough Visual Basic, you can use win32com.client to send Excel the commands. Acutally, If you record a macro of the task you can figure out what commands to send with the added ability to specify the file names, etc.
May 24 '07 #3

shahjapan
P: 63
If you know enough Visual Basic, you can use win32com.client to send Excel the commands. Acutally, If you record a macro of the task you can figure out what commands to send with the added ability to specify the file names, etc.
some readymade scripts are availbale for python to convert the excel to csv.

but thats is not the point.

point is that we want to convert the csv file anyway in such a format that python can read whole file accuretly,

it can be generated from any soft.

or we need to set some argument in python so DictReader can read the values including special characters and including new lines,etc
May 28 '07 #4

shahjapan
P: 63
some readymade scripts are availbale for python to convert the excel to csv.

but thats is not the point.

point is that we want to convert the csv file anyway in such a format that python can read whole file accuretly,

it can be generated from any soft.

or we need to set some argument in python so DictReader can read the values including special characters and including new lines,etc

I also have the same problem reading CSV file under python and it fails when any column data has multiline text
May 28 '07 #5

shahjapan
P: 63
If you know enough Visual Basic, you can use win32com.client to send Excel the commands. Acutally, If you record a macro of the task you can figure out what commands to send with the added ability to specify the file names, etc.

you may read the link below for this problem

Python Bug



http://mail.python.org/pipermail/pyt...ne/033867.html
May 28 '07 #6

shahjapan
P: 63
you may read the link below for this problem

Python Bug



http://mail.python.org/pipermail/pyt...ne/033867.html
problem is solved by just saving the csv file again with the TEXT DELIMINATOR = " and seprated by ,
Jun 11 '07 #7

bartonc
Expert 5K+
P: 6,596
problem is solved by just saving the csv file again with the TEXT DELIMINATOR = " and seprated by ,
Thank you so much for keeping us up-to-date on this issue.
Jun 11 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.