473,671 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ 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.Re place("'", "''")

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.Re place("'", "''")
cDesc = cDesc.Replace(C hr(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=Micr osoft.Jet.OLEDB .4.0;" & _
Data Source=c:\temp\ ;Extended
Properties=""te xt;HDR=YES;FMT= Delimited(;);"" ;")

Thanks for any and all help,

Marc Miller
schema.ini
[css.csv]
ColNameHeader=T RUE
Format=Delimite d(;)
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=OE M
Sep 12 '06 #1
1 1939
"Marc Miller" <mm****@hotmail .comwrote in
news:Os******** ******@TK2MSFTN GP04.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
1792
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 fields which has data containing double quotes. They end up appearing at ? question mark on the website. Any idea how to dispaly the quotes
1
7893
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 (I'm using a vertical bar here for the tab) Field2 will contain: Pant Size 34 Field3 will contain: Waist
0
1672
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 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...
4
7446
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 syntax is being read wrong. Here is the code: lineFile1 = sr.ReadLine
2
10028
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 double-quotes in one of the ten fields and that causes an "Unparsable Record" error and the remaining fields for those records are blank. This is part of a process that should not require manual intervention i.e. using an editor to remove the ". Is there a...
4
25206
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 cell-index put quotation marks around the comma'd result. Example csv line: 43.56,345.2,"1,285,100",45.6
1
4132
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: & & & & & & & and export it in Export Text wizard as text, with delimited, Other: | (pipeline) and Text qualifier as none>next>finish I can get the desired output without quotes. But this is a very long process for a user.
1
4899
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 requirements of Structured Finance & Relationship Teams for "transaction support" at all times, ensuring appropriate analysis and clarity in respect of required/request","",09-Sep-2008,42000,38000,"+ LTA +...
11
4173
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 use double quotes. This causes the parsing to corrupt b/c the csv/text file generator is confusing this with the end of the string. I am aware that using two double quotes is a way to get around this but i am not able to get the csv file to...
0
8483
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8673
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7444
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6236
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.