Importing a TXT file into Access

J

JD

I was importing a TXT file into Access, hoping that each line of the TXT file
would become a separate row in the Access table. However, I found that in
some cases, multiple lines were combined to a single row. I can't find any
rhyme or reason to why some lines were treated this way and others were not.

Does anyone have any clue why this is happening and how I can prevent it?
Thanks.

-JD
 
J

John Nurick

Hi JD,

This is usually caused by inconsistencies in the structure of the text
file. One possibility, if it's a CSV file in which the data looks
something like this

123,"Text field",991.3,"Another text field"

with commas to separate the fields and quote marks to "qualify" text
fields, is that one of the qualifying quote marks is missing, or that
there are quote marks in the data, e.g.

123,"He said, "May I come in?" She opened the door.",403.2

These will throw things out of gear; you have to either replace them
with apostrophes or double them:

123,"He said, 'May I come in?' She opened the door.",403.2
123,"He said, ""May I come in?"" She opened the door.",403.2

If that's not the cause, please post back with much more information
about the text file.
 

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