Forum Discussion
Importing Multiple Text Files
Example:
bs.txt
ddn.txt
hh.txt
73m.txt
likewise so on. My task is to import all these tiles in MS Access database. Where I can work on these files. If I have 50 files today. I have to manual click the each text file and import them. It's very time consuming job.
- ComputerLearningZoneMar 30, 2022Brass ContributorUse a while loop with the DIR function to get the filenames, then inside your loop perform your import. I cover the DIR function in: https://599cd.com/ACD31 - and I'm sure there's a TON of different free resources available online. Google it.
- George_HepworthMar 30, 2022Silver Contributor
Thank you. As I noted, I can probably provide some code, but you would need to adapt it to your situation yourself. It's on a back up computer, so I'll have to start it and find the appropriate files. Later today.
- George_HepworthMar 31, 2022Silver Contributor
George_Hepworth After I finally located a back up of the relational database application to which I referred earlier (it was in the wrong subfolder of a backup drive), I realized that it is even more complex than I'd recalled, so much so that trying to provide it as a template seems to be hopeless overkill. I'm sorry I got your hopes up. It would take hours to even cut it down to an example that might be usable.
That said, I didn't just want to drop it. Attached you'll find the core module that explores one or more folders and any subfolders in them and returns a list of files found.
As you can see, it's not a simple matter and I don't have time to put it into a more generic form.
I know that's of little help, but it's about the extent of what I can offer. Perhaps someone has an already simplified procedure to share.