Hello,
I have a script where I read an input file, which contains a bunch of URL
strings of differing sizes. I split each element into an array based on the
slash ("/"). After that, I take one of the elements from the array, and
change it to another, and then put the URL string back together. The issue
I'm having is when I put it back together in a for each loop, it writes each
element onto its own line. Also, at the end of the line it puts a slash at
the end. How can I get each element to print on the same line, also omitting
the final slash? Here's the snippet of my code that does all this work...
Any help is greatly appreciated!
Sheel
example of line in input file: http://www.sheel.com/this/is/only/atest.pdf
Set myInputFile = fso.OpenTextFile("<input file>", ForReading)
Set MyOutputFile = fso.CreateTextFile("<output file>", True)
Dim arrIPAddress
Dim orgSplitter
Dim i
i = 0
Do Until myInputFile.AtEndOfStream
strLine = myInputFile.ReadLine
If inStr(strLine, "/") Then
arrIPAddress = split(strLine,"/")
arrIPAddress(2) = "www.soa.org"
For Each item in arrIPAddress
MyOutputFile.Writeline(item & "/")
i = i + 1
Next
End If
Loop