473,623 Members | 3,366 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 12088
"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
1790
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
2466
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
6484
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
18939
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
2192
by: Webgour | last post by:
How to go from string "abc" to string "a|b|c"?
3
6027
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
2558
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
3049
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
8162
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
8662
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
8603
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8317
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,...
0
7134
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
6104
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
4067
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
4154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2593
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 we have to send another system

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.