473,883 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connection string for Piped Delimiter CSV

Yan
hi,
I need to connect a csv file as data source. the connection string currently
using is

cnxStr = "Driver={Micros oft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Te xt;HDR=No;FMT=D elimited;IMEX=1 \"""

it's working, however it's only able to read a row as one column. I have
multiple columns in a row, delimited by pipe (|). What's the variables i need
to add/change to the connection string in order for it to be able to come out
with a multiple columns datatable.

Thanks

Nov 21 '05 #1
5 12099
"Yan" <Ya*@discussion s.microsoft.com > wrote in message news:B2******** *************** ***********@mic rosoft.com...
hi,
I need to connect a csv file as data source. the connection string currently
using is

cnxStr = "Driver={Micros oft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Te xt;HDR=No;FMT=D elimited;IMEX=1 \"""

it's working, however it's only able to read a row as one column. I have
multiple columns in a row, delimited by pipe (|). What's the variables i need
to add/change to the connection string in order for it to be able to come out
with a multiple columns datatable.

Thanks


You may need to include a schema.ini file to specify the custom delimiter. Have a look at
http://msdn.microsoft.com/library/de...a_ini_file.asp
and specifically "Custom Delimited." This may work in the connection string, but I have never tried it.

--

Al Reid
Nov 21 '05 #2
The Microsoft Text Driver is the slowest CSV parser going. You should
atleast switch to using the Jet driver.

http://www.geocities.com/shriop/csv_benchmarks.html

Al Reid wrote:
"Yan" <Ya*@discussion s.microsoft.com > wrote in message news:B2******** *************** ***********@mic rosoft.com...
hi,
I need to connect a csv file as data source. the connection string currently
using is

cnxStr = "Driver={Micros oft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Te xt;HDR=No;FMT=D elimited;IMEX=1 \"""

it's working, however it's only able to read a row as one column. I have
multiple columns in a row, delimited by pipe (|). What's the variables i need
to add/change to the connection string in order for it to be able to come out
with a multiple columns datatable.

Thanks


You may need to include a schema.ini file to specify the custom delimiter. Have a look at
http://msdn.microsoft.com/library/de...a_ini_file.asp
and specifically "Custom Delimited." This may work in the connection string, but I have never tried it.

--

Al Reid


Nov 21 '05 #3
On Thu, 23 Jun 2005 07:27:05 -0400, "Al Reid" <ar*****@reidDA SHhome.com> wrote:

¤ "Yan" <Ya*@discussion s.microsoft.com > wrote in message news:B2******** *************** ***********@mic rosoft.com...
¤ > hi,
¤ > I need to connect a csv file as data source. the connection string currently
¤ > using is
¤ >
¤ > cnxStr = "Driver={Micros oft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
¤ > ";Extended Properties=""Te xt;HDR=No;FMT=D elimited;IMEX=1 \"""
¤ >
¤ > it's working, however it's only able to read a row as one column. I have
¤ > multiple columns in a row, delimited by pipe (|). What's the variables i need
¤ > to add/change to the connection string in order for it to be able to come out
¤ > with a multiple columns datatable.
¤ >
¤ > Thanks
¤ >
¤
¤ You may need to include a schema.ini file to specify the custom delimiter. Have a look at
¤ http://msdn.microsoft.com/library/de...a_ini_file.asp
¤ and specifically "Custom Delimited." This may work in the connection string, but I have never tried it.

The connection string doesn't support custom delimiters so a schema.ini file must be used, as you
mentioned.

[Test.csv]
ColNameHeader=F alse
CharacterSet=AN SI
Format=Delimite d(|)
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #4
Yan
does Jet driver support Pipe delimiter? Can it use scheme.ini as well?

"shriop" wrote:
The Microsoft Text Driver is the slowest CSV parser going. You should
atleast switch to using the Jet driver.

http://www.geocities.com/shriop/csv_benchmarks.html

Al Reid wrote:
"Yan" <Ya*@discussion s.microsoft.com > wrote in message news:B2******** *************** ***********@mic rosoft.com...
hi,
I need to connect a csv file as data source. the connection string currently
using is

cnxStr = "Driver={Micros oft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Te xt;HDR=No;FMT=D elimited;IMEX=1 \"""

it's working, however it's only able to read a row as one column. I have
multiple columns in a row, delimited by pipe (|). What's the variables i need
to add/change to the connection string in order for it to be able to come out
with a multiple columns datatable.

Thanks


You may need to include a schema.ini file to specify the custom delimiter. Have a look at
http://msdn.microsoft.com/library/de...a_ini_file.asp
and specifically "Custom Delimited." This may work in the connection string, but I have never tried it.

--

Al Reid


Nov 21 '05 #5

"Yan" <Ya*@discussion s.microsoft.com > wrote in message news:59******** *************** ***********@mic rosoft.com...
does Jet driver support Pipe delimiter? Can it use scheme.ini as well?


Yes.
Nov 21 '05 #6

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

Similar topics

5
1803
by: Christopher Benson-Manica | last post by:
The function in question follows: vector<string>& tokenize( const string& s, vector<string>& v, char delimiter=',' ) { int delim_idx, begin_idx=0, len=s.length(); for( delim_idx=s.find_first_of(delimiter,begin_idx) ;
3
2478
by: Old Wolf | last post by:
Hi all. G++ fails to compile the following: #include <string> int main() { std::string foo("abc=123"); std::string::const_iterator delimiter = std::find(foo.begin(), foo.end(), '=');
2
6498
by: rmartin | last post by:
I need to conect my software from a remote client to a server, my standard connection: Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=;Initial Catalog=MyDb;Data Source=192.168.0.100;Network=DBMSSOCN; and Provider=SQLOLEDB.1;Persist Security Info=False;User
5
18981
by: Adam Parkin | last post by:
Hello all, I am seeking some help with the following problem. I'm working on an application where I have a resource file, and in this resource file what I want to store is a list of file names (that is, essentially a string array). The potential solutions I see are: 1) Convert the string array into one big string with each element separated by some special value, store that string into the resource file's string table as a single...
6
2203
by: Webgour | last post by:
How to go from string "abc" to string "a|b|c"?
3
6037
by: Rico | last post by:
If there are consecutive occurrences of characters from the given delimiter, String.Split() and Regex.Split() produce an empty string as the token that's between such consecutive occurrences. It sounds like making sense, but has anyone ever found this useful? Can this 'feature' be disabled? After having used StringTokenizer from the J-language that's not to be named, it's annoyed me for hours before I figured out that it was just a...
10
2861
by: Jon | last post by:
I want to count the number of instances of a certain string(delimiter) in another string. I didn't see a function to do this in the framework (if there is, please point me to it). If not, could someone let me know if the method I've used below is efficient or if there is a better way to do it, as these will be rather large strings I'm searching in. Thanks Public Shared Function CountDelimiter(ByVal strInput As String, ByVal...
35
2596
by: Cor | last post by:
Hallo, I have promised Jay B yesterday to do some tests. The subject was a string evaluation that Jon had send in. Jay B was in doubt what was better because there was a discussion in the C# newsgroup on 25 September. The regular expressions where in that newsgroup too involved. I told yesterday night, to Jay that I would test all 4 methods and the stupid method I was thinking of the first time that night when I saw Jon's
1
3067
by: kellysgirl | last post by:
Now what you are going to see posted here is both the set of instructions I was given..and the code I have written. The instructions I was given are as follows In this case, you will create a Visual Basic 2005 solution that manipulates strings. It will parse a string containing a list of items within a text box and put the individual items into the list box. It will build the textbox string by putting the list box items together into a...
0
9933
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
9781
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
11123
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...
1
10836
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7960
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
7114
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5794
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...
0
5982
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4211
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.