Forum Discussion
Lewist57
Jun 22, 2021Copper Contributor
Importing text into a single field of existing database
I hate asking this, as I have figured it out before, but cannot remember how I did it. I have a simple Access database table with six fields. The second field is a text field. I have a text file...
isladogs
Jun 22, 2021MVP
Yes you can use the Import Text wizard...with or without the Advanced button depending on your needs. That partly depends on the other fields in your table e.g. do you have an auto number primary key field. Are any of the other fields required?
Or you can link the text file as a linked table then run an append query.
Or you can do this in code using DoCmd.TransferText
Or you can link the text file as a linked table then run an append query.
Or you can do this in code using DoCmd.TransferText
Lewist57
Jun 23, 2021Copper Contributor
SOLUTION
1) the first line of text in the text file should be the same as the field title that you want to insert the data into. For example, if you are appending new records by inserting lines of text into the TITLE field, then the first line in the text file should be TITLE.
2) Start the text insert wizard.
3) Chose "delimited" for the input type.
4) Click on the check box that says the first line in the file contains the name of the field you want the text to be inserted into.
5) The deliminator type was automatically chosen to be a comma; this made no difference for me as the text records being imported are filenames, which do not contain commas.
6) Hit finish, and new records with the text in the appropriate field are added to the table.