Backward reading of a file in C#
-
I have an XML file that may go upto 1GB and may contaion 5 lakh records. I wanted to retrieve last or latest 3000 records. I was trying to use XmlTextReader, but was a fail. Is there any way by which i can read from end of a XML file and get all the details taking into account of performance. Thanks in advance
Praveen Raghuvanshi Software Engineer,
-
I have an XML file that may go upto 1GB and may contaion 5 lakh records. I wanted to retrieve last or latest 3000 records. I was trying to use XmlTextReader, but was a fail. Is there any way by which i can read from end of a XML file and get all the details taking into account of performance. Thanks in advance
Praveen Raghuvanshi Software Engineer,
Use xPath, it's the quickest method of reading xml. However if you only need the latest 3000 records, i'd recommend creating a temp-file like construction in order to read the required data only.
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
Use xPath, it's the quickest method of reading xml. However if you only need the latest 3000 records, i'd recommend creating a temp-file like construction in order to read the required data only.
.: I love it when a plan comes together :. http://www.zonderpunt.nl
Thanks Eduard for your reply..... could you please elaborate or send me a link for xPath and the other solution described by you. Also, how i will be reading the find from end....
Praveen Raghuvanshi Software Engineer
-
Thanks Eduard for your reply..... could you please elaborate or send me a link for xPath and the other solution described by you. Also, how i will be reading the find from end....
Praveen Raghuvanshi Software Engineer
xPath is supported by the .NET framework in the namespace System.XML.XPath. You can find loads of manuals, how-to's and articles around the web.
I love it when a plan comes together