Jump to content

robochop

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by robochop

  1. Thanks Chris. It's your actual do and for loops in your script below that i am interested in. So if my array - Dim myArray(6) myArray(0) = "Value1=emailaddress1" myArray(1) = "Value2=emailaddress2" myArray(2) = "Value3=emailaddress3" myArray(3) = "Value4=emailaddress4" myArray(4) = "Value5=emailaddress5" How can i use your below script to read each value and then split by finding the "=" sign and then get the emailaddress value Regards j = 0 Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.Readline j = j + 1 arrServiceList = Split(strNextLine , "=") Wscript.Echo "name: " & arrServiceList(0) For i = 1 to Ubound(arrServiceList) Wscript.Echo "value: " & arrServiceList(i) myarray(j) = arrServiceList(1) Next Loop For i = 1 to Ubound(myarray) do something with myarray(i) next
  2. Hi Chris, not sure if you will get this but taking your below script how would you use it or recode it for a defined array in the vbscript and not from a text file ? Regards Greg Dim myArray(6) Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile("c:\scripts\name and value.txt", ForReading) j = 0 Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.Readline j = j + 1 arrServiceList = Split(strNextLine , "=") Wscript.Echo "name: " & arrServiceList(0) For i = 1 to Ubound(arrServiceList) Wscript.Echo "value: " & arrServiceList(i) myarray(j) = arrServiceList(1) Next Loop For i = 1 to Ubound(myarray) do something with myarray(i) next
×
×
  • Create New...