We help IT Professionals succeed at work.

Access: Importing Multiple Text Files with Unknown Specs or Delim/Fixed Width

64 Views
Last Modified: 2017-04-16
I am looking for some help in the following case. I have various text files to import into an Access db but the files are not consistent. Some are pipe delimited while others are fixed width. The end goal is to import one field the account field. What i am looking to do is, while looping through the text files to choose the proper Specification, generally it is 1 of 3 specs and/or if Pipe Delimited or Fixed Width.

Currently, the workaround is to import each file in the directory three times and then to delete the tables that are empty or less than the 8 char account record.

Any help is appreciated.


Or if anything a solution to choose spec based on file name?
Comment
Watch Question

CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
Offered code sample to identify file type based on extension.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions