473,498 Members | 1,832 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={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Text;HDR=No;FMT=Delimited;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 12083
"Yan" <Ya*@discussions.microsoft.com> wrote in message news:B2**********************************@microsof t.com...
hi,
I need to connect a csv file as data source. the connection string currently
using is

cnxStr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Text;HDR=No;FMT=Delimited;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*@discussions.microsoft.com> wrote in message news:B2**********************************@microsof t.com...
hi,
I need to connect a csv file as data source. the connection string currently
using is

cnxStr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Text;HDR=No;FMT=Delimited;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*****@reidDASHhome.com> wrote:

¤ "Yan" <Ya*@discussions.microsoft.com> wrote in message news:B2**********************************@microsof t.com...
¤ > hi,
¤ > I need to connect a csv file as data source. the connection string currently
¤ > using is
¤ >
¤ > cnxStr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
¤ > ";Extended Properties=""Text;HDR=No;FMT=Delimited;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=False
CharacterSet=ANSI
Format=Delimited(|)
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*@discussions.microsoft.com> wrote in message news:B2**********************************@microsof t.com...
hi,
I need to connect a csv file as data source. the connection string currently
using is

cnxStr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + CSVFolder +
";Extended Properties=""Text;HDR=No;FMT=Delimited;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*@discussions.microsoft.com> wrote in message news:59**********************************@microsof t.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
1783
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(...
3
2454
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
6474
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...
5
18919
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...
6
2181
by: Webgour | last post by:
How to go from string "abc" to string "a|b|c"?
3
6013
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...
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...
35
2527
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#...
1
3037
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...
0
7121
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,...
0
7162
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,...
1
6881
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
5456
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,...
0
4584
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
3088
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
1411
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 ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
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...

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.