I have a loading program which I wrote a few years ago, and I'd like to make some changes to it.

It's only function is to load text files from a network drive into our Oracle database. It works fine, but here's how it currently works.

Open the app-->click "Select file"-->select the text file from the dialogue box-->select "Run"--> file loads and is moved to another directory.

The text files in the directory are generated one per day. Sometimes when I go to load the data there are a few days worth of files in there, and sometimes it's just one file I need to load.

What I'd like to do is modify the program so that upon opening it just searches the directory for text files and loads them automatically.

Since the program is already written as stated above, I just need to know how to scan a directory for text files. I can make it work from there.

I've read about the DIR function as well as some other methods, but I'm not sure I get them. Any tips or nudges in the right direction would be appreciated.