|
-
Nov 21st, 2000, 08:39 AM
#1
Thread Starter
Addicted Member
Hi guys
I have the following function that reads the contents of one of my files. However, I have hundreds of files that I want to read individually. How do I put all the .txt files that I have in my folder into an array and put them through this function????
Thanks for any help.
JK
Code:
Public Function Opening_Files_For_Reading()
Dim inputfile As String
inputfile = "D:\Orator\Outgone\00007629000003.txt"
'***************************************'
'Input the file ---- into a string named TempFile'
'***************************************'
TempFile = "" 'initialise tempfile
Open inputfile For Input As #1
Do While Not EOF(1) ' Check for end of file.
Line Input #1, GenFileText ' Read line of data.
TempFile = TempFile & GenFileText 'increment the temporary string with the file data
MsgBox GenFileText
Loop
Close #1
End Function
-
Nov 21st, 2000, 09:03 AM
#2
-
Nov 21st, 2000, 09:07 AM
#3
Thread Starter
Addicted Member
Cheers guys
Thanks a lot for the help guys.
paulw, what I'm trying to do when I finish here is pass the file contents into a parsing routine which will send the data up to a database.
-
Nov 21st, 2000, 09:14 AM
#4
Fanatic Member
You might be more efficient if you open up the database connection and read the data in in one go. If the files are small, there may well be several in the buffer.
Cheers,
Paul.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 21st, 2000, 09:18 AM
#5
Thread Starter
Addicted Member
Thanks a lot for the input.
There are several hundered files in the folders and what I need to do is actually place a timestamp on each file that I parse in order to eliminate the possibility to duplictes in the database.
Any suggestions on how I might do this, more efficiently??
Thanks again,
Your help is really appreciated
JK
-
Nov 21st, 2000, 09:28 AM
#6
_______
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 21st, 2000, 09:37 AM
#7
Frenzied Member
...and to get it:
MsgBox FileDateTime("MYFILE")
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|