Problem Characters in Importing a Text/ CSV File

B

Bob Barnes

These characters "embedded" in a standard CSV structure...
.....commas, apostrophes, double-quotes, carriage return/ linefeed...
will cause problems when running code such as..

Line Input #iNumOne, vTheFile
...............

Are there any other characters to cause similar problems?

TIA - Bob
 
D

Dirk Goldgar

Bob Barnes said:
These characters "embedded" in a standard CSV structure...
....commas, apostrophes, double-quotes, carriage return/ linefeed...
will cause problems when running code such as..

Line Input #iNumOne, vTheFile
...............

Are there any other characters to cause similar problems?


Actually, of the characters you mentioned, only the carriage return/line
feed combination would cause a problem to the Line Input statement, because
CR/LF marks the end of a line. Commas, apostrophes, and quotes will make no
difference for that statement.

They may well have an effect on a delimited-text file import, or in other
code where Access is trying to parse the line into fields. In the case of
an import made via DoCmd.TransferText, you can use an import-output
specification to get control over the handling of those characters.
 

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