Trim() isn't stipping tab characters off my data in vbscript
- From: Barry <Barry@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 9 Jan 2008 09:08:15 -0800
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
.
- Follow-Ups:
- Re: Trim() isn't stipping tab characters off my data in vbscript
- From: ekkehard.horner
- Re: Trim() isn't stipping tab characters off my data in vbscript
- Prev by Date: LaunchApp.WSF Vista/Kix Logon Script Problem
- Next by Date: Re: Trim() isn't stipping tab characters off my data in vbscript
- Previous by thread: LaunchApp.WSF Vista/Kix Logon Script Problem
- Next by thread: Re: Trim() isn't stipping tab characters off my data in vbscript
- Index(es):
Relevant Pages
|
|