View Full Version : txt file


shariefoo
11-07-2003, 08:30 PM
Hi all,

How can i import a .txt file into access ? The feilds are seperated by a tab not a ","..

please help

Fuga
11-08-2003, 04:08 AM
You use File->get external data. Ther is a wizard there to guide you. Tab delimited is one of the options.

Fuga.

shariefoo
11-08-2003, 08:31 PM
Thanx Fuga but i want it done automatically.

Like using Macros.

i tried useing Import Delimited in macro but it imported everything in one feild because they are not seperated by a comma.

Is there a way where i could tell access to seperate the feilds from tab ?

Fuga
11-09-2003, 05:39 AM
Yes, this is what i use. I use it as an on_open event, but of course you can have it as a button click event or what ever.
DoCmd.TransferText acImportDelim, "your importspecification", "yourtable", "c:\yourdir\yourfile.txt"


In "your importspecification" you choose the right options for tab delimited etc.

Fuga.

Fuga
11-09-2003, 05:41 AM
Sorry, form_open is the name of the event.
Private sub form_open()
DoCmd.TransferText acImportDelim, "your importspecification", "your table", "c:\yourdir\yourfile.txt"
end sub

Fuga.

shariefoo
11-09-2003, 08:16 PM
Thanx Figa

shariefoo
11-09-2003, 08:23 PM
Good morning Fuga..

I am really sorry to bother you but one last Question.

WHat did you mean by "choose the right options for tab delimited" ?

Didnt get you on that.

Do u mean just write tab ?

Fuga
11-10-2003, 04:08 AM
Hi, Shariefoo.

There is a wizard you can use to import txt files. You will be given some options as to which character separates the fields. Thatīs when you choose tab.

If you click the advanced tab, you will be able to save your import settings (your importspecification), not only with the tab delimited but with field types etc.

So what I meant was (I realize I forgot to mention that) that you do one import manually to save an importspecification (with tab delimited).

Fuga.

shariefoo
11-10-2003, 08:35 PM
Good morning Fuga.

Thanx Alot for the information. Thank you

cavscout
11-12-2003, 12:12 PM
If you haven't found anything that works already.

Check out the "transfertext" function under macros. I'm using this and it works great. Simple and effective.