W
William Foster
Good evening all,
I am trying to write a process that uses a while loop to cycle multiple
files from an array throught the StreamReader Process.
The whole thing works using:
Dim Import_File_Reader As System.IO.StreamReader
While ...
Import_File_Reader = New StreamReader(Import_File_and_Path)
.... Extract all the data I want then start again ....
End While
However, when I get to the second run through it always return an error
saying that there was an illegal character included in the
Import_File_and_Path variable; on checking there are no illegal characters.
All I can think is that without closing off the Import_File_Reader variable
before running through the While loop for a second time it will not work,
however, when I add in Import_File_Reader.Close towards the bottom of the
While Loop it still doesn't work [The same error is returned].
I am a bit lost know, if anyone has any ideas on how to get this to work it
would be greatly appreciated if you could respond to this query as I am left
with the option of opening every file seperately through different variables
if this doesn't work; and with over 700 files to be opened I am not liking
that option.
Yours sincerely,
William Foster
I am trying to write a process that uses a while loop to cycle multiple
files from an array throught the StreamReader Process.
The whole thing works using:
Dim Import_File_Reader As System.IO.StreamReader
While ...
Import_File_Reader = New StreamReader(Import_File_and_Path)
.... Extract all the data I want then start again ....
End While
However, when I get to the second run through it always return an error
saying that there was an illegal character included in the
Import_File_and_Path variable; on checking there are no illegal characters.
All I can think is that without closing off the Import_File_Reader variable
before running through the While loop for a second time it will not work,
however, when I add in Import_File_Reader.Close towards the bottom of the
While Loop it still doesn't work [The same error is returned].
I am a bit lost know, if anyone has any ideas on how to get this to work it
would be greatly appreciated if you could respond to this query as I am left
with the option of opening every file seperately through different variables
if this doesn't work; and with over 700 files to be opened I am not liking
that option.
Yours sincerely,
William Foster