save xls to csv/dbf without Excel/win32com.client
Tim Chase
python.list at tim.thechases.com
Sun Jun 6 21:47:27 EDT 2010
On 06/06/2010 06:59 PM, noydb wrote:
> On Jun 5, 9:31 pm, Tim Chase<python.l... at tim.thechases.com> wrote:
>> [1]http://pypi.python.org/pypi/xlrd/
>
> Many thanks Tim, this worked well!
>
> In the interest of learning, anyone have a XLS to DBF solution?
This becomes considerably trickier unless you're willing to have
all your DBF fields be CHAR-format rather than their actual
data-type. In an Excel file, one column can hold multiple
data-types (text, numbers, formulas, dates, currency, etc)
whereas (from my humble understanding) a single column in a DBF
must be of the same data-type.
That said, if you want to attempt it, I'd suggest using
http://dbfpy.sourceforge.net/
to create the DBF files using code similar to my CSV version
(which mostly iterates over the Excel workbook and dumps the
contents to CSV files -- just change it to dump the contents to
your DBF).
-tkc
More information about the Python-list
mailing list