By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Importing text files in to Access

P: n/a
I have a large amount of log files from an electronic contro tester that I
need to import in to an Access database
Unfortunately, they are not comma delimited or fixed with but different
fields are on separte lines

MO NO 123456
serial no xyz
date

Obviously , the Access import wizard can not handle this format.
Can any one give me any advice on how I my import this data in to an
existing Access table?

thanks in advance
Dave
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In your example:
MO NO 123456
serial no xyz
date
1. Search the file for the string "MO NO " and replace with an empty string
"".

2. Search for Chr(13) & Chr(10) & "serial no " and replace with a comma
",".

3. Search for Chr(13) & Chr(10) & "date " and replace with a comma ",".

4. You can now import the file as a comma delimited file.

P
"Debbie CD UK" <mi*******@hotmail.com> wrote in message
news:10****************@iris.uk.clara.net... I have a large amount of log files from an electronic contro tester that I
need to import in to an Access database
Unfortunately, they are not comma delimited or fixed with but different
fields are on separte lines

MO NO 123456
serial no xyz
date

Obviously , the Access import wizard can not handle this format.
Can any one give me any advice on how I my import this data in to an
existing Access table?

thanks in advance
Dave

Nov 12 '05 #2

P: n/a
"hal boyles" <ha********@timeinc.com> wrote in message news:<bk**********@inntp-m1.news.aol.com>...
No format, no import.
I suggest using Word or Excel to celan the data first.


If you have a lot of these things to import, I would put them all into
the same directory and then loop through the directory and process
each one...

1. Clean with Word.
2. Save cleaned copy in new directory.
3. Move "raw" copy to a "processed" directory.
4. Loop through the files in the "processed directory" and import
them.

If you use the Dir function, you can loop through all the files in a
folder and process them individually. You could just do something
like record a macro in Word that did your Find/Replace routines, and
just call it from within your Access code (be sure to include a
reference to your Word library if you use early binding). Then you
could import the processed files using Access. (I would save them as
CSV or text files)
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.