On 8 mar, 20:49, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have a large file that has many lines like this, > > <element tag="300a,0014" vr="CS" vm="1" len="4" > name="DoseReferenceStructureType">SITE</element> > > I would like to identify the line by the tag (300a,0014) and then grab > the name (DoseReferenceStructureType) and value (SITE).
It's obviously an XML file, so use a XML parser - there are SAX and DOM parsers in the stdlib, as well as the ElementTree module. -- http://mail.python.org/mailman/listinfo/python-list