Try
' Create an instance of StreamReader to read from a file.
Dim sr As StreamReader = New StreamReader("C:\XLS-TO-TEXT\USING-XLS-LIB\XLStoTEXT\bin\FINAL.txt")
Dim sw As StreamWriter = File.CreateText("C:\XLS-TO-TEXT\USING-XLS-LIB\XLStoTEXT\bin\FINAL1.txt")
Dim line As String
' Read and display the lines from the file until the end
' of the file is reached.
Do
line = String.Empty
line = sr.ReadLine()
line = line.Replace(ControlChars.Tab, "^")
line = line.Replace(ControlChars.Quote, "")
sw.WriteLine(line)
sw.Flush()
Loop Until line Is Nothing
sr.Close()
sw.Close()
Catch E As Exception
' Let the user know what went wrong.
Console.WriteLine("The file could not be read:")
Console.WriteLine(E.Message)
End Try
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.