I'm trying to modify specific lines in a 6 gig text file (SQL script). So I read it in with IO.StreamReader.ReadLine
and write to a new file with IO.StreamWriter.WriteLine
. If the line matches a certain condition, I'm modifiying it before I write it.
The problem is, the resulting file is exactly half (1.999582...) the size of the original file...
I'm trying to make sure the encoding is the same using:
sw = New IO.StreamWriter(NewFilepath, False, sr.CurrentEncoding)
But it doesn't make a difference, the new file is half the size of the old...