pyExcelerator - Can I read and modify an existing Excel-WorkBook?
- From: Stephen Brown <sbrown@xxxxxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 19:37:52 +0200
Yes indeed, pyExcelerator does support reading data from excel spreadsheets. An example of how to do this is included in the file xls2csv-gerry.py under the directory ... pyExcelerator/examples/tools Syntax is pretty straight forward. extract_all = parse_xls(filename, CP = None) where CP is the encoding format used within tht file. Uses same codes that xlrd uses, ie 'cp437' = US English.
All you need is the "parse_xls" command and simply let it iterate through your spread*** file.
EXAMPLE:
fname = "D:\\Directory\\myfile.xls" # an example filename
for sheet_name, values in parse_xls(fname ): # parse_xls(arg) -- default encoding
print " name of sheet is = ", sheet_name,
Alternatively you can extract everything in one go...
extract_all = parse_xls(fname)
.
- Follow-Ups:
- Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?
- From: John Machin
- Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?
- Prev by Date: Re: REALLY simple xml reader
- Next by Date: Re: Removal of element from list while traversing causes the next element to be skipped
- Previous by thread: very simple Genetic Algorithm completed
- Next by thread: Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?
- Index(es):