So the below code is what I use to process an ASCII file line by line. It works great... UNLESS the file has been copied from a linux or apple machine, which has the different line endings (is it CR instead of CRLF?).
Can someone suggest a tweak to the code below to make it handle BOTH types of line endings?
Thanks very much...
Dim strm As New IO.StreamReader(sourcefilepath)
Dim txt As String = strm.ReadToEnd
Dim sr As New IO.StringReader(txt)
While Not sr.Peek < 0
line_text = sr.ReadLine
' do something with line