K
Kevin Vogler
I'm trying to read through a text file (15,000 lines) and do a replace on
each line. The stream reader says that I've reached the end of the file at
around 7500 lines and subsequent reads return nothing. What am I doing
wrong?
Thanks in advance.
Dim Fs As FileStream = New FileStream(filename, _
FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)
Dim FSW As FileStream = New FileStream("C:\new.csv", FileMode.OpenOrCreate,
FileAccess.Write, FileShare.Write)
Dim sw As New StreamWriter(FSW)
Dim sr As New StreamReader(Fs)
Dim input As String = ""
Dim sl As String = ""
While (InlineAssignHelper(input, sr.ReadLine())) IsNot Nothing
sl = sl.Remove(0, 1).Replace(Chr(34) + Chr(44),
Chr(126)).Replace(Chr(44) + Chr(34), Chr(126)).Replace(Chr(34) + Chr(126),
Chr(126)).Replace(Chr(126) + Chr(34), Ch(126))
sw.WriteLine(sl)
End While
Kevin Vogler
each line. The stream reader says that I've reached the end of the file at
around 7500 lines and subsequent reads return nothing. What am I doing
wrong?
Thanks in advance.
Dim Fs As FileStream = New FileStream(filename, _
FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)
Dim FSW As FileStream = New FileStream("C:\new.csv", FileMode.OpenOrCreate,
FileAccess.Write, FileShare.Write)
Dim sw As New StreamWriter(FSW)
Dim sr As New StreamReader(Fs)
Dim input As String = ""
Dim sl As String = ""
While (InlineAssignHelper(input, sr.ReadLine())) IsNot Nothing
sl = sl.Remove(0, 1).Replace(Chr(34) + Chr(44),
Chr(126)).Replace(Chr(44) + Chr(34), Chr(126)).Replace(Chr(34) + Chr(126),
Chr(126)).Replace(Chr(126) + Chr(34), Ch(126))
sw.WriteLine(sl)
End While
Kevin Vogler