Delightful Python
DaveP
DaveP at NEARLYdpawson.freeserve.co.uk
Tue Nov 12 04:56:26 EST 2002
"Mike Brown" <mike at skew.org> wrote in
news:3dba5dfb$1_1 at omega.dimensional.com:
>> Mixing that with some Java software from Danny,
>> http://www.isacat.net/2001/code/CSVtoXML.htm
>> I came up with a working
>> program in a couple of days, without a frown, in fact with
>> quite a few smiles. Eg. when I had to escape & and non ascii
>> characters, a one line addition in python.
>> Only on one occasion did I find some code that didn't do what I
>> expected.
>> My only documentation was that delivered with 2.2, clear, concise
>> well written and well indexed.
>>
>> Many thanks pythoneers, a delight to use.
>>
>> Regards DaveP.
>
> Python could certainly replace that Java bit. One way of going about
> it is at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66003
> ... though I'd be inclined to make it generate SAX events rather than
> paste together strings.
Hi Mike. Still catching up after a week away. In fact I had to dump the
Java, it didn't handle a case I had, data which contained CR characters
in
double quoted fields, so I used a python csv parser in the end!
Some nice ideas in your reference though.
I like the way the java picked its tags to use from an external file,
which makes it infinitely flexible. I now use it in a batch file for 5
files!
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/159100
Regards DaveP
More information about the Python-list
mailing list