Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Macro to import ascii files into a table

Posted on 2004-09-07
4
Medium Priority
?
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Assisted Solution

by:_agj_
_agj_ earned 1000 total points
ID: 11996673
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
ID: 11998387
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 1000 total points
ID: 12002714
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
ID: 12002856
Thanks agj and Erick37!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

618 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