Re: delineating by comma where commas inside quotation marks don't count

2007-10-25 Thread Travis Brady
v reader = csv.reader(open('testfile.txt')) for ct,row in enumerate(reader): print "var2=", row[2] if ct>2: break The comma separated list parser in pyparsing is also great for this, particularly when the input gets dirtier: http://pyparsing.wikispaces.com/space

Re: parsing the output from matlab

2007-10-23 Thread Travis Brady
p('variable'), var.group ('value')) : : x1 = 0.5 But I'm betting these files get more complex than just the snippet you included, in which case it's probably worth looking at pyparsing http://pyparsing.wikispaces.com/ and regular expressions. -- Travis Brady http://travisbrady.com/ -- http://mail.python.org/mailman/listinfo/python-list