Link to home
Start Free TrialLog in
Avatar of mrong
mrong

asked on

VBScript Skip blank spaces

Greeting,

I have the following code in my vbscript which split the txt file. Right now it only split by a blank space how to skip if there are more than one blank spaces in between?

Do While Not f.AtEndOfStream
 
   line = f.Readline
  columns = split(line, " ")
  strColumn1 = columns(0)
  strColumn2 = columns(1)
  strColumn3 = columns(2)

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrong
mrong

ASKER

changed to the followings and works.

Do While Instr(strLine, "  ") > 0
         strLine = Replace(strLine, "  ", " ")
         Loop
      arrNames = Split(strLine, " ")
        strColumn1 = arrNames(0)
        strColumn2 = arrNames(1)