Reading Formatted Text File
drew at gremlinhosting.com
Sat Nov 20 15:02:02 CET 2004
There was an article on parser generators in this mailing list a couple
of days ago - given the relative complexity of the format you've shown
below you might try simple regex matching but only if you know all the
input is valid.
Some places you might want to look:
http://christophe.delord.free.fr/soft/tpg/ - Parser generator
http://dparser.sourceforge.net/ - Another parser generator (both are
And, of course, diveintopython's most excellent regular expression
Hope this helps!
On Sat, 2004-11-20 at 05:34 -0800, Kevin McBrearty wrote:
> Hello All,
> I'm trying to read a formatted text of strings and
> floats. I have looked through previous posts and
> couldn't deciper a good method. I'm new to python so
> any suggestions would be helpful.
> solid SIMPLEBLOCK
> facet normal 0.000000e+00 0.000000e+00 -1.000000e+00
> outer loop
> vertex 1.000000e+00 -1.000000e+00 0.000000e+00
> vertex -1.000000e+00 -1.000000e+00 0.000000e+00
> vertex -1.000000e+00 1.000000e+00 0.000000e+00
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
Andrew James <drew at gremlinhosting.com>
More information about the Python-list