473,462 Members | 1,128 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dbl.quotes in a text file data

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 into a dataset, then looping thru the
dataset and
storing the field values to vars and then doing an 'INSERT INTO' an SQL
Server table.
The text file that has records containing single quotes and double quote
within the data (not qualifiers).
Is there any way to mass change
The text file that has records containing single quotes within the data (not
qualifiers).
I solved that with :
cDesc = tb.Rows(i).Item(4).ToString.Replace("'", "''")

But then I also found records containing double quotes within the data (not
qualifiers).
So I tried (fyi - chr(22) is a double quote):
cDesc = tb.Rows(i).Item(4).ToString.Replace("'", "''")
cDesc = cDesc.Replace(Chr(22), Chr(22) & Chr(22))

But the only thing I get in the dataset is the beginning of the string: SOME
There are additional columns after this in the real data, and they get
filled with DBNULLs.

Below is my connection and my schema.ini for the text file.
Dim oConn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
Data Source=c:\temp\;Extended
Properties=""text;HDR=YES;FMT=Delimited(;);"";")

Thanks for any and all help,

Marc Miller
schema.ini
[css.csv]
ColNameHeader=TRUE
Format=Delimited(;)
MaxScanRows=150
Col1=Sup_Name Text Width 24
Col2=Emp_Name Text Width 24
Col3=Emp_ID Text Width 4
Col4=ScreenID Text Width 8
Col5=Desc Text Width 79
CharacterSet=OEM
Sep 12 '06 #1
1 1929
"Marc Miller" <mm****@hotmail.comwrote in
news:Os**************@TK2MSFTNGP04.phx.gbl:

I have a text file that I'm reading into a dataset, then looping thru
the dataset and
storing the field values to vars and then doing an 'INSERT INTO' an
SQL Server table.
The text file that has records containing single quotes and double
quote within the data (not qualifiers).
Is there any way to mass change
If you're going to be loading data this way... you should use SQL
Parameters - this will format the strings correctly for you.

Otherwise, take a look at:

BCP/Bulk Insert/Bulk Load
DTS
SQL Server Integration Servers

DTS and SSIS are the preferred methods of loading large data files.
Sep 13 '06 #2

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

Similar topics

1
by: nurddin19 | last post by:
Hi, I have an Excel file (which is converted to csv by a tool and then uploaded to a MySQL database) and then php is used to display the data on the website. In the Excel file i have text...
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...
0
by: Masa Ito | last post by:
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...
4
by: Justin Fancy | last post by:
Hi everyone, I need to replace all instances of a double quote(") with two single quotes('') in a text file. I already have some replacements of strings going on, but I tried this one, but the...
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...
4
by: sherifffruitfly | last post by:
Hi all, I've got a csv file for numeric data, some of which are greater than 10^3. Some bright fellow trying to br helpful put US-standard commas in these numbers, and to maintain the correct...
1
by: maryanncanor | last post by:
Hi I would like to know if there is a macro that can export the data from a query to an output textfile that has NO QUOTES. If I run the concatenated query Expr1: & & & & & & & ...
1
by: Yearwood | last post by:
Hi, I'm basically trying to import a CSV into an ACCESS database. Sample date is shown below: "",10173,"Development Manager - Social Economy Sector","Trust Bank",10153,,"Lolalll Pudd","Meet the...
11
by: tfurubay | last post by:
Hi, I am developing a DB that imports a CSV file from a commerce site. The file is a CSV file with double quotes to identify text. In this file, there is a memo field where people occassionally...
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...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.