Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert tabs to carrort character in a tab delimeted text file? 1

Status
Not open for further replies.

vinidel

IS-IT--Management
Jan 23, 2004
78
US
Hi ALL,

I want convert a tabs in tab delimeted text file to carrort characters. Can anyone guide me how to do it using VB.NET code.

Thanks
 
Sorry I misspelled Delimited as Delimeted.
 
Thanks ThatRickyGuy for your guidance.

Here is the code if someone needs it:

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top