[Zope] Comma delimited file and the re python object

Darrell dgallion@rochester.rr.com
Sat, 6 Nov 1999 07:10:41 -0500


I coded it in 'C' and the performance is about ~60X faster than the regular
expression solution. And handles nested quotes.

Send me a note if this is something worth finishing up and posting
somewhere.

####### Test
txt="""
"Bond, James", 13, 45
'That\'s "absolutely" possible.', 1999, 8, 30
"""

buf=txt
buf=buf*50000
print len(buf)
t1=time.time()
l=split(buf)
print len(l)
print "Time: %.2f"%(time.time()-t1)
print l[4]
print l[5]

#### Output:
3400000    # 3.4meg input
100000       # Number of records
Time: 1.91    # Runtime
            # Some output
['Bond', ' James', '13', '45']
['That\'s "absolutely" possible.', '1999', '8', '30']

--Darrell


----- Original Message -----
From: Li Dongfeng <mavip5@inet.polyu.edu.hk>
To: Max M <maxm@normik.dk>
Cc: <Zope@zope.org>
Sent: Thursday, November 04, 1999 11:55 PM
Subject: Re: [Zope] Comma delimited file and the re python object


>
> I have got a working solution for this.
> I have done this to read in user supplied datasets.
>
> The solution is ugly, slow, but works for me.
>