473,395 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Text Import Problem (Quoted Identifier and Comma-delimited)

Access 2K, SP3 on Windows 2K, SP4

All,

I have an import spec set up with quoted Identifiers and comma-separated
values. The text file is produced by a 3rd-party program of which I have no
control. It outputs all text fields surrounded by quotes, and all numeric
fields w/o quotes. All fields are separated with commas.

This has been working for 2 years, until today, when one of the data fields
contained quotes in the data itself.

At that spot in the data file, it looks like this:

...... ,"", "WHITE", 34.6, "USES A "1"", "09897", .....

The data typed by the users was: USES A "1", and the export routine oblidgingly
but quotes around all of it to get: "USES A "1""

Here's the crazy part: The Import Text Wizard preview window CORRECTLY parses
the file (well, the vertical lines are in the right place!), but upon import,
the row in question has no data imported after the word "A", and there exists
an ImportErrors table showing that row as "Unparsable Record."

Excel correctly parses the file, FWIW.

Can anyone shed any light on this? Why can the wizard draw the lines in the
right place, but Access' import engine can't handle it? It seems to that the
users should be able to use quotes whenever they want...after all, with quoted
identifiers AND comma-separation, the import engine should be able to handle
this. I "might" understand if quotes and commas were mixed, but this doesn't
have that.

Yes, I know I can write my own parser...I'd just like to know why Access is
confused by this data.
Nov 12 '05 #1
1 9706
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Access isn't confused - the exported text data is incorrectly
formatted. It should be formatted like this:

"USES A ""1""",

The quotes need to be escaped when inside a string delimited by quotes
- - so they will be evaluated as data characters instead of delimiter
characters. Escaping quotes is usually accomplished by a preceeding
the character quote with an escape quote.

But you'll say "Why does Excel import the file OK?" Don't know -
probably 'cuz it ignores the quotes and only recognizes the commas as
field delimiters.

You may want to change your import spec to have {none} as the Text
qualifier and the comma as the field delimiter. But, then you'll have
to watch out for fields that contain commas - they will parse out as
multiple fields instead of one field.

HTH,

MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP5hf8oechKqOuFEgEQInxwCeKDCkPXZJOtGLHd7MYrRU4b IBjN8AoMUn
ISK3+GAATe1tNvTrzFZjQYTy
=ISRV
-----END PGP SIGNATURE-----

DCM Fan wrote:
Access 2K, SP3 on Windows 2K, SP4

All,

I have an import spec set up with quoted Identifiers and comma-separated
values. The text file is produced by a 3rd-party program of which I have no
control. It outputs all text fields surrounded by quotes, and all numeric
fields w/o quotes. All fields are separated with commas.

This has been working for 2 years, until today, when one of the data fields
contained quotes in the data itself.

At that spot in the data file, it looks like this:

..... ,"", "WHITE", 34.6, "USES A "1"", "09897", .....

The data typed by the users was: USES A "1", and the export routine oblidgingly
but quotes around all of it to get: "USES A "1""

Here's the crazy part: The Import Text Wizard preview window CORRECTLY parses
the file (well, the vertical lines are in the right place!), but upon import,
the row in question has no data imported after the word "A", and there exists
an ImportErrors table showing that row as "Unparsable Record."

Excel correctly parses the file, FWIW.

Can anyone shed any light on this? Why can the wizard draw the lines in the
right place, but Access' import engine can't handle it? It seems to that the
users should be able to use quotes whenever they want...after all, with quoted
identifiers AND comma-separation, the import engine should be able to handle
this. I "might" understand if quotes and commas were mixed, but this doesn't
have that.

Yes, I know I can write my own parser...I'd just like to know why Access is
confused by this data.


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ed Whittaker | last post by:
Hi, I`m writing a wizard that very much resembles the Excel Text Import Wizard. So far so good but I have been unable to find a control to reproduce the step where the user picks the boundries...
1
by: David Peake | last post by:
Hi All, I use DTs Wizard to import a text file into my MS SQLServer 2000 every month. This text file contains 236 text fields and it's format never changes. The problem that i've found is...
10
by: Paulo Jan | last post by:
Hi all: Let's say I'm designing a database (Postgres 7.3) with a list of all email accounts in a certain server: CREATE TABLE emails ( clienteid INT4, direccion VARCHAR(512) PRIMARY KEY,...
0
by: King Ron | last post by:
Access2002/WinXP Has anyone come up with a resolution for the text import wizard GUI breaking down after installing patches? When building a new table using the gui, the cursor moves to the...
1
by: usenethelp | last post by:
Has anyone had this problem where using the Text Import Wizard in Access 2002 Service Pack 3 does not allow you to change the field names for any field except the first one? If so, is there a...
1
by: Jenny | last post by:
Since I got a new PC with XP and the latest version of Access on it, I have been having problems with the Text Import Wizard. In the section where you specify the field options, when I click on...
0
by: yuppiest | last post by:
Dear All, I'm trying to import a quite large text file (25mb) I had this working fine by using the transfertext command and having a schema.ini file, however having changed the username and...
2
by: lwhite | last post by:
MS SQL 2000 sp4 on WinXp Pro SP2 I am very new to this so please let me know what I can do to make it easier for you to understand the problem. I have a non delimited text file. This text...
0
by: S_K | last post by:
Hi, I'm creating a TableAdapter against an Oracle database. I can successfully create a simple (one table) TableAdapter, test the SQL query, click the Next button twice and click the Finish...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.