Improving my text processing script
ptmcg at austin.rr.com
Fri Sep 2 00:42:14 CEST 2005
Yes indeed, the real data often has surprising differences from the
It turns out that pyparsing LineStart()'s are pretty fussy. Usually,
pyparsing is very forgiving about whitespace between expressions, but
it turns out that LineStart *must* be followed by the next expression,
with no leading whitespace.
Fortunately, your syntax is really quite forgiving, in that your
key-value pairs appear to always be an unquoted word (for the key) and
a quoted string (for the value). So you should be able to get this
working just by dropping the LineStart()'s from your expressions, that
See if that works any better for you.
More information about the Python-list