How do you read comma delimited data from programs such as Excel where the
data itself contains dounble quotes and commas. It used to be you could just
use input. How is it fone now?
The data below contains output from Access saved as a CSV.
line 1,"normal data","a double quote "" here"
line 2,"a comma , here ","more normal data"
Input's help documents the "" will not work. 7 11309
You would use a StreamReader to read the file line by line.
Then perform a .Split(@"\",\"") on the string.
--
2004 and 2005 Microsoft MVP C#
Robbe Morris http://www.masterado.net
Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp
"Ron McCafferty" <ro***********@community.nospam> wrote in message
news:AB**********************************@microsof t.com... How do you read comma delimited data from programs such as Excel where the data itself contains dounble quotes and commas. It used to be you could just use input. How is it fone now?
The data below contains output from Access saved as a CSV. line 1,"normal data","a double quote "" here" line 2,"a comma , here ","more normal data"
Input's help documents the "" will not work.
You would use a StreamReader to read the file line by line.
Then perform a .Split(@"\",\"") on the string.
--
2004 and 2005 Microsoft MVP C#
Robbe Morris http://www.masterado.net
Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp
"Ron McCafferty" <ro***********@community.nospam> wrote in message
news:AB**********************************@microsof t.com... How do you read comma delimited data from programs such as Excel where the data itself contains dounble quotes and commas. It used to be you could just use input. How is it fone now?
The data below contains output from Access saved as a CSV. line 1,"normal data","a double quote "" here" line 2,"a comma , here ","more normal data"
Input's help documents the "" will not work.
Try my parser, http://www.geocities.com/shriop/index.html
Robbe Morris [C# MVP] wrote: You would use a StreamReader to read the file line by line. Then perform a .Split(@"\",\"") on the string.
-- 2004 and 2005 Microsoft MVP C# Robbe Morris http://www.masterado.net
Earn $$$ money answering .NET Framework messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp "Ron McCafferty" <ro***********@community.nospam> wrote in message news:AB**********************************@microsof t.com... How do you read comma delimited data from programs such as Excel where the data itself contains dounble quotes and commas. It used to be you could just use input. How is it fone now?
The data below contains output from Access saved as a CSV. line 1,"normal data","a double quote "" here" line 2,"a comma , here ","more normal data"
Input's help documents the "" will not work.
Try my parser, http://www.geocities.com/shriop/index.html
Robbe Morris [C# MVP] wrote: You would use a StreamReader to read the file line by line. Then perform a .Split(@"\",\"") on the string.
-- 2004 and 2005 Microsoft MVP C# Robbe Morris http://www.masterado.net
Earn $$$ money answering .NET Framework messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp "Ron McCafferty" <ro***********@community.nospam> wrote in message news:AB**********************************@microsof t.com... How do you read comma delimited data from programs such as Excel where the data itself contains dounble quotes and commas. It used to be you could just use input. How is it fone now?
The data below contains output from Access saved as a CSV. line 1,"normal data","a double quote "" here" line 2,"a comma , here ","more normal data"
Input's help documents the "" will not work.
Robbe,
As I understand the split function wouldn't that split on every "?
For example "7 inches""" would return 7 inches and "" and not 7 inches"
Thanks,
Ron
"Robbe Morris [C# MVP]" wrote: You would use a StreamReader to read the file line by line. Then perform a .Split(@"\",\"") on the string.
-- 2004 and 2005 Microsoft MVP C# Robbe Morris http://www.masterado.net
Earn $$$ money answering .NET Framework messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp "Ron McCafferty" <ro***********@community.nospam> wrote in message news:AB**********************************@microsof t.com... How do you read comma delimited data from programs such as Excel where the data itself contains dounble quotes and commas. It used to be you could just use input. How is it fone now?
The data below contains output from Access saved as a CSV. line 1,"normal data","a double quote "" here" line 2,"a comma , here ","more normal data"
Input's help documents the "" will not work.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ron McCafferty |
last post by:
How do you read comma delimited data from programs such as Excel where the
data itself contains dounble quotes and commas. It used to be you could just
use input. How is it fone now?
The data...
|
by: Elmo Watson |
last post by:
I've been asked to develop a semi-automated type situation where we have a
database table (sql server) and periodically, there will be a comma
delimited file from which we need to import the data,...
|
by: John B. Lorenz |
last post by:
I'm attempting to write an input routine that reads from a comma delimited
file. I need to read in one record at a time, assign each field to a field
array and then continue with my normal...
|
by: Hilary Cotter |
last post by:
Thanks for all the help you gave me yesterday.
here is another question.
I have a comma delimited file called redirect.txt which looks like
this
test, /test.htm
test 123,/test123.htm
|
by: Leonard Wright |
last post by:
I'm developing a lottery program and want read a text file that has
Draw date
Draw number
six lottery numbers
all in comma delimited text file
I want the user to select a draw number
to show...
|
by: ungvichian |
last post by:
So, right now I'm writing a program in VC++.Net with MFC, and one of
the steps involves reading numeric values from a comma delimited file
(like 4.56, 2.44, 3.453 etc.). The only methods I've been...
|
by: Bernie Yaeger |
last post by:
Is there a way to convert or copy a .xml file to a comma delimited text file
using vb .net?
Thanks for any help.
Bernie Yaeger
|
by: P K |
last post by:
I read a CSV file using a stream reader.
I read a complete line using readline. I need to get hold of each column.
I can't use split function with a comma cos the contents in the columns
might...
|
by: Wes Peters |
last post by:
Does anyone know of an article that deals with the subject of reading a
structured text file using VBA code in Access?
Thanks,
Wes
|
by: =?Utf-8?B?UmljaA==?= |
last post by:
'--this code works but only reads text into one column when contains multiple
cols
Dim ds1x As New DataSet
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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: 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...
|
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...
|
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...
| |