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

Remove Spaces

Status
Not open for further replies.

Kreiss

Programmer
Oct 8, 2003
48
0
0
US
I have a string in a text file....
R99999999999 0

I want to remove the spaces between the last 9 and the zero so it looks like this: R999999999990. I tried using "Trim", but no luck. Any advice?

Do While Not ts.AtEndOfStream

s = ts.ReadLine
autECLSession.autECLPS.SendKeys "DLN/"+s+".PM1."
autECLSession.autECLPS.SendKeys"[Enter]"

Loop
 
Hello Kreiss,

replace("R9999999 0"," ","")

regards - tsuji
 
Further note:

Of course the function return a string, you have to assign it to a variable---that's what I meant
s=replace("R9999999 0"," ","")

- tsuji
 
Ok, Thanks...Howabout if there were three spaces between....
R99999999999 0
 
The snippet tsuji gaves you replace ALL spaces by empty string.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Ok, I guess whats between the 9 and the zero is actual a tab. I looked at the text file and brought it into word and this is what I saw. Notice the graphic indicating its a tab between the two. How do I "Replace" the tab with ""?

R99999999999->0

Thanks in advance,
Kacy
 
I've got it figured out. I goahead and save it as a comma delimitted file rather than just copying the data over into a textfile. It works.

Thanks for everyone's help.

kacy
 
Anyway, in VBS a tab character may be addressed with vbTab or Chr(9)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Thanks...Good to know about the vbTab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top