Stephen Brown
1/31/2008 5:38:00 PM
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 spreadsheet 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)