473,378 Members | 1,405 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,378 software developers and data experts.

ADO choking on quotes inside a pipe delimited text file

I have pipe delimited (and comma/tab) files that I read with JET using a
schema file. Occasionally a field has multiple quotes (") inside a single
field - which chokes the line (the rest of the columns get read as
nulls). An example of an offending line is:
J" Invalid " ....
This is a text field that is between the two 'pipes' so I need it read
exactly as is.

I have reverted to schema files, trying everything I can to overcome this
problem. If I open the file in Excel or do a DTS into SQL it parses it
fine (as they seem to be properly formatted 'delimited' files). While I
am having this problem I am forced to open in excel and save as an excel
file (which JET reads fine), or hack regex's that change these quotes.
This is very time consuming as these files are extremely large.

I assume it is something to do with telling Jet (through the schema file)
to ignore quotes inside fields - or at least treat them as part of the
regular text. But I have checked MS (best I have found is:
http://msdn.microsoft.com/library/de...l=/library/en-
us/odbc/htm/odbcjetschema_ini_file.asp )
and scoured google etc...
Code to read the file:
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & sPath & ";Extended Properties=Text;"
Dim objConn As New System.Data.OleDb.OleDbConnection(sConnectionStrin g)
objConn.Open()
Dim objCmdSelect As New OleDbCommand("SELECT * FROM 1.txt", objConn)
Dim objAdapter1 As New OleDbDataAdapter
objAdapter1.SelectCommand = objCmdSelect

Dim ds As New DataSet
objAdapter1.Fill(ds)
ojbConn.Close()

Schema file:
[1.txt]
ColNameHeader=False
CharacterSet=ANSI
Format=Delimited(|)
Col1="User Name" Text
.....
May 31 '06 #1
0 1653

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

Similar topics

2
by: Techie Guy | last post by:
I'm trying to process a tab delimited file where each line in the file has around 12 tab delimited elements. My problem is the elements are surrounded by "quotes" and I need the script to remove...
1
by: Tom | last post by:
I can't get the Microsoft Jet OLEDB 4.0 driver to read a tab delimited text file that has double quotes imbedded in the data. For example Field1 | Field2 | Field3 Bob | Pant Size 34" Waist | 22...
1
by: Marc Miller | last post by:
Hello everyone, First I'll address this as a textfile manipulation question and if there is no answer there, then I'll need to ask it as a vb ADO question. I have a text file that I'm reading...
1
by: bhups | last post by:
hi, i am doing a lookup using hash table. I have a pipe delimited file that i have to search for a new invocie number field by checking of an old invoice number-customer number key combination...
2
by: Sheldon | last post by:
I'm using DoCmd.TransferText acImportDelim... to import a tab-delimited ..txt file using an Import Specification file and that works fine. The problem is that a few records could have...
1
by: Fordraiders | last post by:
vb.net 2003 Office 2003 What I have: C:\TestData\Input.txt Text File Pipe Delimited : 4 columns Of data example: 00001|NO BRAND NAME ASSIGNED|6DU27|M3-.5 X 6 FLAT HD SOCKET CAP SCREW,...
1
by: Al G | last post by:
Hi, I am reading a CSV file with the code below. When I run into a " (quote mark) in the file, I get a "malformed line" exception. Can anyone point me to a way to handle this? Thanks in...
8
benchpolo
by: benchpolo | last post by:
Data Row 1 -> AAA|123|ABCDE|929292||183 EAST WAY #A11|223|TX|CA|12 Data Row 2 -> BBB|123|ABCDE|||183 EAST WAY #A11|223|TX|CA|12 Data Row 3 -> VVV||ABCDE|929292||183 EAST WAY #A11|223|TX|CA|12 Data...
7
by: skunkwerk | last post by:
Hi, i'm trying to call subprocess.popen on the 'rename' function in linux. When I run the command from the shell, like so: rename -vn 's/\.htm$/\.html/' *.htm it works fine... however when I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.