Help parsing a text file

William Gill nospam at domain.invalid
Mon Aug 29 14:56:05 EDT 2011


On 8/29/2011 2:31 PM, Philip Semanchuk wrote:
>
> If the syntax really is close to XML, would it be all that difficult to convert it to proper XML? Then you have nice libraries like ElementTree to use for parsing.
>

Possibly, but I would still need the same search algorithms to find the 
opening tag for the field, then find and replace the next line end with 
a matching closing tag.  So it seems to me that the starting point is 
the same, and then it's my choice to either process the substrings 
myself or employ something like ElementTree.



More information about the Python-list mailing list