J
Justin Fancy
Hi Everyone,
I'm lookin for a very confusing loop (to me), to compare two files.
Here it is. I have two arrays with paths stored in both. example:
/en/aviation/you.htm.
I need to search array two for all the paths in array 1. If it finds
it, send it to array 3.
Here's my code to send it to the array.
Dim sr As IO.StreamReader = IO.File.OpenText(File1)
'Loop through Directory Listing file to load filepaths into an
array
While sr.Peek <> -1
'Count the number of lines (for the arrays), and read in
the lines
counter += 1
lineFile1 = sr.ReadLine
'Re-Dimension the array to hold "counter" number of
elements
ReDim InternetDirectoryArray(counter)
'String Manipulation (Replace some unneeded text)
MyString = lineFile1
Dim sb As New System.Text.StringBuilder(MyString)
sb.Replace("C:", "")
sb.Replace("x:", "")
sb.Replace("\", "/")
sb.Replace("wwwroot", "")
MyString = sb.ToString()
InternetDirectoryArray(counter) = MyString
End While
'Close the first file
sr.Close()
'Open the second file
sr = IO.File.OpenText(File2)
i = 0
i2 = 0
counter2 = 0
Do While sr.Peek <> -1
counter2 += 1
lineFile2 = sr.ReadLine
MyString2 = lineFile2
Dim sb2 As New System.Text.StringBuilder(MyString2)
sb2.Replace("C:", "")
sb2.Replace("x:", "")
sb2.Replace("\", "/")
sb2.Replace("wwwroot", "")
MyString2 = sb2.ToString()
ReDim Preserve IISLogArray(counter2)
IISLogArray(counter2) = MyString2
Loop
--------------------------------------------------------------------
I've tried for hours on how to get the logic down, but its confusing me
too much. Maybe someone know's what to do.
Thanks for your help.
Justin
I'm lookin for a very confusing loop (to me), to compare two files.
Here it is. I have two arrays with paths stored in both. example:
/en/aviation/you.htm.
I need to search array two for all the paths in array 1. If it finds
it, send it to array 3.
Here's my code to send it to the array.
Dim sr As IO.StreamReader = IO.File.OpenText(File1)
'Loop through Directory Listing file to load filepaths into an
array
While sr.Peek <> -1
'Count the number of lines (for the arrays), and read in
the lines
counter += 1
lineFile1 = sr.ReadLine
'Re-Dimension the array to hold "counter" number of
elements
ReDim InternetDirectoryArray(counter)
'String Manipulation (Replace some unneeded text)
MyString = lineFile1
Dim sb As New System.Text.StringBuilder(MyString)
sb.Replace("C:", "")
sb.Replace("x:", "")
sb.Replace("\", "/")
sb.Replace("wwwroot", "")
MyString = sb.ToString()
InternetDirectoryArray(counter) = MyString
End While
'Close the first file
sr.Close()
'Open the second file
sr = IO.File.OpenText(File2)
i = 0
i2 = 0
counter2 = 0
Do While sr.Peek <> -1
counter2 += 1
lineFile2 = sr.ReadLine
MyString2 = lineFile2
Dim sb2 As New System.Text.StringBuilder(MyString2)
sb2.Replace("C:", "")
sb2.Replace("x:", "")
sb2.Replace("\", "/")
sb2.Replace("wwwroot", "")
MyString2 = sb2.ToString()
ReDim Preserve IISLogArray(counter2)
IISLogArray(counter2) = MyString2
Loop
--------------------------------------------------------------------
I've tried for hours on how to get the logic down, but its confusing me
too much. Maybe someone know's what to do.
Thanks for your help.
Justin