hi, how do i insert few row in an existing excel file using python? the excel file maybe be of any excel version. On windows that could have been possible by using win32com.client...but i need to make the changes in the linux environment. how can i do it?
hi,is there some way where in i can directly insert the data into the exisiting sheet? the way you suggested helps, but then it will involve copying a existing sheet and then creating a new one to have my data included in it.
crystal
2010-02-25 05:59:23
I am not sure - I usually use Java and POI. When I download the library and look at the source files the workbook object has a get_sheet method which returns a worksheet in the workbook. You can probably do all the insertions you want with that worksheet.
TheSteve0
2010-02-25 06:11:44
@TheSteve0: Don't believe everything that you read in a blog; "here is how to write Excel or OpenOffice.org Calc spreadsheet files using Python and the xlwt library" ... write OpenOffice.org Calc spreadsheet files with xlwt??? News to me.
John Machin
2010-02-25 07:28:33
@crystal: That's exactly what happens when a user opens a file with Excel [loads contents into memory], adds some more data [in memory], and saves it [REMOVE OLD FILE, write new file from memory]. An Excel file has a complicated structure; it's a much bigger deal than appending a bunch of fixed-size blocks to an exiisting file.
John Machin
2010-02-25 10:49:59
Hey John - I was just focusing on Crystal using it for excel - not the OO use.
TheSteve0
2010-02-25 21:27:07
+2
A:
you can use pyExcelerator. the package comes with example demos to write excel files
ghostdog74
2010-02-25 06:05:39
xlwt is a fork of pyExcelerator so the demos are probably the same. Based on this http://groups.google.com/group/python-excel/browse_thread/thread/ea65395fc7856beeI would say that pyExcelerator is no longer maintained
TheSteve0
2010-02-25 06:14:58
@ghostdog74: pyExcelerator has a bad case of the Norwegian Blue Parrot syndrome. xlwt has extra functionality, better speed, uses less memory and has a tutorial ... see http://www.python-excel.org
John Machin
2010-02-25 07:35:04