This question already has an answer here:
- How does one parse XML files? 8 answers
THIS IS NOT AN XML FILE AND I'M NOT USING XML FILES. Merely trying to parse a text file with xml like taggs.
I have a text file containing xml like text and I have to parse individual values to store in individual variables.
<product>
<name>name1</name>
<desc>desc1</desc>
<cost>233.90</cost>
<rdate>25122015</rdate>
<imgsrc></imgsrc>
<drate>10</drate>
</product>
<product>
<name>name2</name>
<desc>desc2</desc>
<rdate>25122015</rdate>
<imgsrc></imgsrc>
<drate>10</drate>
<cost>243.90</cost>
</product>
...
Is there a way to parse such a text file based on those tags in C#?
Edit: This is not an xml file and I'm not allowed to use 3rd party librarys to parse it.