• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

Macro to import ascii files into a table

I have a large number of  ascii files stored in a folder c:\tmp.
Each file has four columns seperated by tabs. There is no header row.  

Here are a few rows from one file:
08/13/2004      AAC.AX      1.4      7212730
08/16/2004      AAC.AX      1.4      675351
08/17/2004      AAC.AX      1.4      161616

I want to import the contents of these files into a single table, using the same column order.  

Is there a quick and easy way to do this using Access VBA?

Thank you!
0
tomfolinsbee
Asked:
tomfolinsbee
  • 2
2 Solutions
 
_agj_Commented:
u can combine all of these into a single file using a batch command like:

cd c:\tmp
for %f in <*.*> do type %f >> all.txt


now u can just open this, select all the text and copy paste into an access table.
0
 
tomfolinsbeeAuthor Commented:
Thanks agj, I didn't realise you could thing like that with the Dos prompt!

I typed it typed it in exactly as above, including spaces and got this message:

< was unexpected at this time

In case that makes in difference,  I'm using Windows XP and the file names look like this:  AAC.AX_D


0
 
Erick37Commented:
To correct the DOS syntax, the line from agj should read:
for %f in (*.*) do type %f >> all.txt

Would you prefer a VB solution?
0
 
tomfolinsbeeAuthor Commented:
Thanks agj and Erick37!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now