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

Create Dynamic array from text file, then run command

Status
Not open for further replies.
Jul 30, 2004
7
US
Hi

I have a vbscript file that includes some functions and that generates a text file as seen below. The next step in my automation quest is to perform a secondary task/command/function of all URL’s containing Using the example below I would need to run the command on 6 URL’s (the command does not need to run on the first primary URL)

I've been reading about arrays and was wondering how to create a dynamic array for all the site URL's (- the first one) in my text file then may excute the command for every line within the array.

----------------------------------------------------------------------------------
<Sites Count="7">
<Site Url=" Owner="LAB1\fred.sa" />
<Site Url=" Owner="ITN\bob" SecondaryOwner=" ITN\jack" />
<Site Url=" Owner=" ITN\jill" />
<Site Url=" Owner=" ITN\bart" SecondaryOwner=" ITN\maggie" />
<Site Url=" Owner=" ITN\homer" SecondaryOwner=" ITN\mo" />
<Site Url=" Owner="ITN\maggie" SecondaryOwner=" ITN\homer" />
<Site Url=" Owner="ITN\lisa" SecondaryOwner=" ITN\maggie" />
</Sites>
----------------------------------------------------------------------------------

I’m new to vbscripting, so any help with this would be greatly appreciated. Also I'm not sure if I have explained myself as best as I can, let me know if I should start again.

Kind Regards

Herschel
 
Take a look at Dim myArray() and at the ReDim Preserve instruction.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top