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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Tab fields from Text File

Status
Not open for further replies.

DesertDBA

Programmer
Jan 27, 2004
4
US
I want to remove the Tab fields from the Text File I am importing. The file is a ASCII text file, but when I use READLINE to get the data it is reading in the TAB code. How can I remove the Tab code from the import??

Example of the Text File :
A_MASTERID 546
A_FNAME Fred
A_MI
A_LNAME Milner
...

- Jason Milner
 
Code:
TextBox2.Text = TextBox1.Text.Replace(" ", "tab")

the first " " is actually just a tab I typed.


Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
I tried the controlchars.tab and it didn't seem to work.

Desertdba will tell us wich one did.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
You *could* use regular expressions as well...

Dim ResultString As String
Try
ResultString = Regex.Replace(SubjectString, "[\t]", "")
Catch ex As ArgumentException
'Syntax error in the regular expression
End Try

--
James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top