Combining files

  • Thread starter Thread starter Harmony
  • Start date Start date
H

Harmony

Hello,

I need to combine multiple dat files into one text file.
These dat files are all named the same for example :
01162004.dat but are in 23 different subfolders. How do I
search through these subfolders for this specific file
name and combine it into one text file?

Any help would be great!!

Thanks,

Harmony
 
Create an import routine and load all the data into Access.
Then export to a single file.

The routine can loop through a list of Paths (that you store in a table).
This way if you add more folders you just add the paths to the table and run
the import again.
 
How would I do that?

Thanks,

Harmony
-----Original Message-----
Create an import routine and load all the data into Access.
Then export to a single file.

The routine can loop through a list of Paths (that you store in a table).
This way if you add more folders you just add the paths to the table and run
the import again.
--
Joe Fallon
Access MVP






.
 
Something along these lines:

How to Import all Files in a Folder:

Private Sub btnImportAllFiles_Click()
'procedure to import all files in a directory and delete them.
'assumes they are all the correct format for an ASCII delimited import.
Dim strfile As String

ChDir ("c:\MyFiles")
strfile = Dir("FileName*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, "ImportSpecName", "AccessTableName",
"c:\MyFiles\" & strfile, True
'delete the file (consider moving it to an Archive folder instead.)
Kill "c:\MyFiles\" & strfile
strfile = Dir
Loop

End Sub
 
Back
Top