Trim() isn't stipping tab characters off my data in vbscript



I have a data on our server that houses data for mapping specific folders to
specific users and/or groups in AD. The data file looks like this:

Group, Sales, G:, \\MSO-Server\Groups-Users\Sales
User, All_Users, H:, \\MSO-Server\Groups-Users\Personal_Folders\
Group, Acctng, J:, \\MSO-Server\Groups-Users\Public
Group, H_R, K:, \\MSO-Server\Groups-Users\Human_Resources
Group, Executive, L:, \\MSO-Server\Groups-Users\Executive
Group, All_Users, M:, \\MSO-Server\Groups-Users\Public
Group, NetAdmin, N:, \\MSO-Server\Groups-Users\NetAdm
Group, NetAdmin, O:, \\SBS-Server\C$
Group, NetAdmin, P:, \\SBS-Server\D$

(The blank spaces in the file are tabs for readability.)

The script code reads the input file, populates arrTxtArray(). The code
segment below then parses it into discrete array fields to be used later in
the script for mapping.

For i = LBound(arrTxtArray) To UBound(arrTxtArray)
newArray = Split (arrTxtArray(i), ",")
MapInfo(i, 0) = Trim(newArray(0)) ' User or Group
MapInfo(i, 1) = Trim(NewArray(1)) ' Group Name
MapInfo(i, 2) = Trim(newArray(2)) ' Drive Letter
MapInfo(i, 3) = Trim(newArray(3)) ' Path
WScript.Echo i+1 & ". - " & MapInfo(i, 0) & " - " & MapInfo(i, 1) &_
" - " & MapInfo(i, 2) & " - " & MapInfo(i, 3)
Next

The issue I'm having is that the Trim() command is not stripping the tab
characters off the data as it is written into the MapInfo array. I can tell
this from the wscript.echo command. If I delete the tabs (which makes the
source file hard to
read) the script works fine. What might I use instead of Trim() to
accomplish my task? Thanks in advance. BH

.



Relevant Pages

  • Re: Trim() isnt stipping tab characters off my data in vbscript
    ... I used the replacecommand and it works great. ... The data file looks like this: ... The script code reads the input file, ... If I delete the tabs (which makes the ...
    (microsoft.public.scripting.vbscript)
  • Re: Net use command
    ... All mapping in the ... past was done on the users local computer. ... like to be able to write a script to change the network drives. ... Here is the output from the command ...
    (microsoft.public.win2000.general)
  • Re: WinXP. Unable to map home drive. Maps to root of share only.
    ... is expected to create this mapping: ... Your question about my second batch file is justified. ... > see the when I run your script it works ok but this has always been the ...
    (microsoft.public.win2000.networking)
  • Re: Net use command
    ... Byron Kendrick wrote: ... All mapping in the ... > like to be able to write a script to change the network drives. ... Let's say for example you want to map drive letter P: ...
    (microsoft.public.win2000.general)
  • Re: Can you create a timed loop?
    ... It calls the mapping function 3 times, and I have debugging code to show ... I tried the second suggestion, ... verify that the script was terminating after 10 seconds. ...
    (microsoft.public.scripting.vbscript)