I have a .CSV file that I need to read, reformat, and write back out as a TAB
delimited file. I can't use a slick utility such as DTS, because I have a
lot of tweaking I need to do on the data before it can be output. The data
is true .CSV fasion, in other words, a record may look as follows:
1.23,"this is a ""special"" field",2,"brian's test","one,two,three",45.223344
There are embeded quotes, apostrophes, and commas in the data. This makes
something like Split() out of the question. Is there a method to read a .CSV
and just refer to the columns as an array? 3 54876
Brian Kitt wrote: I have a .CSV file that I need to read, reformat, and write back out as a TAB delimited file. I can't use a slick utility such as DTS, because I have a lot of tweaking I need to do on the data before it can be output. The data is true .CSV fasion, in other words, a record may look as follows: 1.23,"this is a ""special"" field",2,"brian's test","one,two,three",45.223344 There are embeded quotes, apostrophes, and commas in the data. This makes something like Split() out of the question. Is there a method to read a .CSV and just refer to the columns as an array?
afaik there is no such thing built into the framework.
codeproject.com always is a good start. Maybe this will work for you? http://www.codeproject.com/cs/database/CsvReader.asp
Max
That's not necessarily true.
You can use the JET 4.0 OLE DB provider with the classes in the
System.Data.OleDb namespace to access the comma delimited text file (using a
DataSet/DataTable).
Or you could use Microsoft Text Driver for ODBC with the classes in the
System.Data.Odbc namespace to access the file using ODBC drivers.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Markus Stoeger" <sp******@gmx.at> wrote in message
news:en**************@tk2msftngp13.phx.gbl... Brian Kitt wrote: I have a .CSV file that I need to read, reformat, and write back out as a TAB delimited file. I can't use a slick utility such as DTS, because I have a lot of tweaking I need to do on the data before it can be output. The data is true .CSV fasion, in other words, a record may look as follows: 1.23,"this is a ""special"" field",2,"brian's test","one,two,three",45.223344 There are embeded quotes, apostrophes, and commas in the data. This makes something like Split() out of the question. Is there a method to read a .CSV and just refer to the columns as an array?
afaik there is no such thing built into the framework.
codeproject.com always is a good start. Maybe this will work for you? http://www.codeproject.com/cs/database/CsvReader.asp
Max
Hi,
In addition you could use the provider from opennetcf ( www.opennetcf.org )
It's good fast and you have the source code so you can customize it.
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:O4**************@tk2msftngp13.phx.gbl... That's not necessarily true.
You can use the JET 4.0 OLE DB provider with the classes in the System.Data.OleDb namespace to access the comma delimited text file (using a DataSet/DataTable).
Or you could use Microsoft Text Driver for ODBC with the classes in the System.Data.Odbc namespace to access the file using ODBC drivers.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Markus Stoeger" <sp******@gmx.at> wrote in message news:en**************@tk2msftngp13.phx.gbl... Brian Kitt wrote: I have a .CSV file that I need to read, reformat, and write back out as a TAB delimited file. I can't use a slick utility such as DTS, because I have a lot of tweaking I need to do on the data before it can be output. The data is true .CSV fasion, in other words, a record may look as follows: 1.23,"this is a ""special"" field",2,"brian's test","one,two,three",45.223344 There are embeded quotes, apostrophes, and commas in the data. This makes something like Split() out of the question. Is there a method to read a .CSV and just refer to the columns as an array?
afaik there is no such thing built into the framework.
codeproject.com always is a good start. Maybe this will work for you? http://www.codeproject.com/cs/database/CsvReader.asp
Max
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Chris Lasher |
last post by:
Hello,
I have a rather large (100+ MB) FASTA file from which I need to
access records in a random order. The FASTA format is a standard format
for storing molecular biological sequences. Each...
|
by: python |
last post by:
In a file there can be several dictionaries like this
{Key11: Value11
Key12: Value12
Key13: Value13,
....
....
Key1n:Value1n}
{Key21: Value21
Key22: Value22
Key23: Value23,
|
by: Sarah Tanembaum |
last post by:
Beside its an opensource and supported by community, what's the fundamental
differences between PostgreSQL and those high-price commercial database (and
some are bloated such as Oracle) from...
|
by: ship |
last post by:
Hi
We need some advice: We are thinking of upgrading our Access database
from Access 2000 to Access 2004.
How stable is MS Office 2003? (particularly Access 2003).
We are just a small...
|
by: Midnight Java Junkie |
last post by:
Dear Colleagues:
I feel that the dumbest questions are those that are never asked. I have
been given the opportunity to get into .NET. Our organization has a
subscription with Microsoft that...
| |
by: |
last post by:
I have an app that retrieves data from an Access database. At the moment I
have the SQL string as a Const in my app. I understand this is not best
practice. I don't want the user to have access to...
|
by: Ross Reyes |
last post by:
HI -
Sorry for maybe a too simple a question but I googled and also checked my
reference O'Reilly Learning Python
book and I did not find a satisfactory answer.
When I use readlines, what...
|
by: Marcel |
last post by:
Hello all,
I am a C++ beginner.
I would like to know where and how a C++ application stores it's data.
For example, imagine an application to manage your DVD collection. DVD can
be enterd...
|
by: Owen Zhang |
last post by:
What is the best way to implement "tail -f" in C or C++ and higher
performance compared to either unix shell command "tail -f" or perl
File::Tail ? Any suggestion appreciated. Thanks.
|
by: ink |
last post by:
Hi all,
I am trying to pull some financial data off of an HTML web page so that I
can store it in a Database for Sorting and filtering.
I have been thinking about this for some time and trying...
|
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,...
| |
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |