Reading Formatted Text File

Andrew James drew at
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: - Parser generator - 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.
> Regards,
>         Kevin
>   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
>     endloop
>   endfacet
> __________________________________ 
> Do you Yahoo!? 
> The all-new My Yahoo! - Get yours free! 
Andrew James <drew at>

More information about the Python-list mailing list