Solved

Macro to import ascii files into a table

Posted on 2004-09-07
4
388 Views
Last Modified: 2011-04-14
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
Comment
Question by:tomfolinsbee
  • 2
4 Comments
 
LVL 7

Assisted Solution

by:_agj_
_agj_ earned 250 total points
Comment Utility
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
 

Author Comment

by:tomfolinsbee
Comment Utility
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
 
LVL 32

Accepted Solution

by:
Erick37 earned 250 total points
Comment Utility
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
 

Author Comment

by:tomfolinsbee
Comment Utility
Thanks agj and Erick37!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now