How to read text files from Folder and Sub folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I want to read data from a folder called Data. Inside this folder i have
hundreds of folders. They are named by the date for eg 10-01-06 etc. Inside
these folders i have my data stored as text files. I would like to read all
this data under all the sub folders into a Microsoft Access Database. Can
someone help with this. How can i do this?
 
http://advisor.com/doc/16279 will show you how to find all of the files
(replace "mp3" in the sample with "txt").

Once you know all of the files, what exactly do you want to do with the
data? Import it into a single table, or something else? And what's the
format of the data in each file?
 
I want to import them into a single table so it is easy to search. The format
of data is text. they are just notes.
 
You'd use the TransferText method to import them.

The Help file should explain what's necessary.
 
Thank you so much Doughlas! The transertext method didnt work for me.
I did it this way
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFolder & strFile, ForReading)
strCharacters = objFile.readall
and called a docmd. runsql to insert the data.

But you did a great deal of help for me reading folders and sub folders.
Thank you so much
My problem is solved.
 
Back
Top