Assuming that the file is an XML file, this should help.
How well it works depends on the actual file format. Attaching a sample file would help.Code:Dim xe As XElement 'to load from file ' xe=XElement.Load("your path here") 'to test xe = <root> <QuotationInfo> <Info num="0" name="Number of Loops" value="2"/> <Info num="3" name="Number of Contained Symbols" value="2"/> <Info num="4" name="Contained Symbols"> <Symbol name="U-6088-DF-20-3-POS40-D" count="1"/> <Symbol name="U-6088-DF-20-3-POS70-D" count="1"/> </Info> <Info num="5" name="Number of Tools"/> </QuotationInfo> </root> Dim ie As IEnumerable(Of XElement) ie = From el In xe...<QuotationInfo>.Elements Where el.Name.LocalName = "Info" AndAlso el.@num = "4" AndAlso el.@name = "Contained Symbols" From sel In el.Elements Select sel For Each el As XElement In ie Debug.WriteLine("{0} {1}", el.Name.LocalName, el.@name) Next




Reply With Quote
