Novice wants to import text files that don't have anticipated extensions

D

David

I have some table structures established and I'd like to import some
text files. However, these files do not have the anticipated file name
extensions (.txt, .csv, ...etc.). These files have names like
data.dat, data.320, data.s05, etc.
-
How might I be able to tell Access (Access 2003 under WinXP Pro) to
import these text files?
-
Thanks,
David
 
D

David

Thanks for the reply. However, I'd be constantly renaming files, which
have other uses that are determined by their particular extensions. Is
there any way to increase or add to the list of file types that Access
"knows" are text files?
 
D

Douglas J. Steele

http://support.microsoft.com/?id=239471

(Yes, I know that article talks in terms of being able to write to the
files, but it also impacts reading the files).

On the other hand, if you're asking how to change the extension that comes
up associated with text files when you choose the Text Import wizard, I'm
afraid you're out of luck: that's hard coded, and I don't believe it's
possible to change it.
 
D

Dean

I ran into problems a few months back with code. Access 2000 would
import text files with a .prt extention just fine. Access 2003 would
not. I changed the code to copy the *.prt to *.txt (same file name)
then import the *.txt and then delete the *.txt file when done.


Might be beyond a Newbee though. Sorry.
 
D

dd

The easiest way is to rename your files.
open up a dos command prompt and rename all files.

rename *.dat *.txt

Then rename them back to the previous extension. Otherwise, if you can
embed a rename statement in your importing code.

name "file.dat" "file.txt"
docmd.TransferText, "specification name", "table name", "file.txt",...
name "file.txt" "file.dat"

-Duy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top