A
Amritha.Datta
Hi,
I need to replace a string in an XML file. For that purpose I have
writtent he below code. It is working file for a small file say about
100 lines. But It failed and went to out of memory exception if I use
a bigger file. Please let me know if there is any alternate way of
doing it. I do have a file with 3 million records.
Please help.
Dim strFile As String = "C:\temp\TextXML"
Dim result As String
Dim reader As TextReader = File.OpenText(strFile)
result = Regex.Replace(reader.ReadToEnd, "</
NewDataSet><NewDataSet>", "XYZ")
reader.Close()
FileOpen(1, strFile, OpenMode.Output, OpenAccess.Write,
OpenShare.LockWrite)
'Writes the strDocument text to the file
FileSystem.Write(1, result)
'Closes the handle to the file, allowing all programs to edit
the file
FileClose(1)
Thanks.
I need to replace a string in an XML file. For that purpose I have
writtent he below code. It is working file for a small file say about
100 lines. But It failed and went to out of memory exception if I use
a bigger file. Please let me know if there is any alternate way of
doing it. I do have a file with 3 million records.
Please help.
Dim strFile As String = "C:\temp\TextXML"
Dim result As String
Dim reader As TextReader = File.OpenText(strFile)
result = Regex.Replace(reader.ReadToEnd, "</
NewDataSet><NewDataSet>", "XYZ")
reader.Close()
FileOpen(1, strFile, OpenMode.Output, OpenAccess.Write,
OpenShare.LockWrite)
'Writes the strDocument text to the file
FileSystem.Write(1, result)
'Closes the handle to the file, allowing all programs to edit
the file
FileClose(1)
Thanks.