473,383 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Converting a xls file into csv file using Python

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
7 10684
ghostdog74
511 Expert 256MB
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
6,596 Expert 4TB
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
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
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
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
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
6,596 Expert 4TB
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

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

Similar topics

12
by: Peter Wilkinson | last post by:
Hello tlistmembers, I am using the encoding function to convert unicode to ascii. At one point this code was working just fine, however, now it has broken. I am reading a text file that has is...
7
by: i_vincent | last post by:
Hi all, Newbie Python programmer here, so please be patient. I have spent all day googling for an answer to my problem, but everything I try fails to work (or works from the Interpreter with a...
4
by: mustafa | last post by:
Dear sir , I have built my application in visual basic 6.0 and crystal Report8.5 , Now i migrated my application to VB.net using the upgrade wizard.My visual basic form is upgraded to vb.net...
4
by: eight02645999 | last post by:
hi i need help with converting a piece of perl code to python ...... my $start = '\'; my $file = '\'; my $end = '\'; ..... while(<FILE>) #open a file {
8
by: Michael B. Trausch | last post by:
I was wondering if anyone has had any experience with this. Someone I know is trying to move away from Microsoft Works, and I am trying to look into a solution that would convert their data in a...
0
by: Brendon Costa | last post by:
Hi All, I have an application with an embedded python interpreter and i need to get the embedded interpreter to "import" strangely named files as python modules. Anyhow the simple part of the...
11
by: Louis.Soninhu | last post by:
Hi pals I have a list like this mylist= I'd like to remove the first and the last item as they are irrevalent, and convert it to the dict: {'tom':'boss','mike':'manager','paul':'employee'}
5
by: geoffbache | last post by:
Hi all, I have a small python script that doesn't depend on anything except the standard interpreter. I would like to convert it to a small .exe file on Windows that can distributed alone...
4
by: larry | last post by:
Ok I'm a Python noob, been doing OK so far, working on a data conversion program and want to create some character image files from an 8-bit ROM file. Creating the image I've got down, I open...
11
by: Keith Hughitt | last post by:
Hi, I am having a little trouble figuring out how to convert a python datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a UTC date so that when I send it to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.