Varying txt files

gsbatch1

Registered User.
Local time
Today, 11:08
Joined
Dec 28, 2010
Messages
45
I have a folder that has varying text files on a daily basis. I currently have a macro that imports each file, depending on which file it is, and appends it to a permanent table. I then use the table to run some queries, then delete the data in that table, and go on to the next file. Some days the txt files have data and some days there are no files to be used.

Currently I go back through at the end of my macro and save a blank copy of each file with headers only so just in case the next day there was no data, it will not import old data.

Is there anyway to make this faster? Currently it takes 5-10 minutes to go through my txt files and use them and then delete the data.

Like to count the txt files, get a list of all the names, and then match them up to a predetermined list of which files to use when, if they are there.

Example:

Today:
dly60.txt - 560kb
dly30.txt - 12,568kb
I I currently import both use the data for some queries, then delete both leaving headers only for tomorrow.

Tomorrow:
dly60.txt - 2kb (Headers only)
dly30.txt - 8,987kb
I don't want to even have the dly60.txt file there and my VBA to know its not there and not throw up an error looking for it.
 

Users who are viewing this thread

Back
Top Bottom