How do I parse this ? regexp ?

serpent17 at gmail.com serpent17 at gmail.com
Wed Apr 27 12:00:44 EDT 2005


Hello,

 I am not understanding your answer, but I probably asked the wrong
question :-)

I want to remove the commas, and square brackets [ and ] characters and
rewrite this whole line (and all the ones following in a text file
where only space would be a delimiter. How do I do this ?

I have tried this:

f = open(name3,'r')
r = r"\d+\.\d*"
for line in f:
cols = line.split()
data1 = re.findall(r,line)

and then I don't know what to do with either cols nor data1

Jake.




More information about the Python-list mailing list