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 9 3598
Hi Bernie,
A document or an dataset?
Cor Is there a way to convert or copy a .xml file to a comma delimited text
file using vb .net?
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Is there a way to convert or copy a .xml file to a comma delimited text
file using vb .net?
That's an extremely vague question. Could you provide more detail,
specifically what the XML currently looks like and what you want the CSV to
look like?
> That's an extremely vague question. Could you provide more detail, specifically what the XML currently looks like and what you want the CSV
to look like?
Is that a question Jeff, when you have a XMLdocument you have to use the
xmlReader and when it is a dataset you can use the readXML.
That is the only important point in my opinion.
For the last one I have a simple generic sample.
By the way Bernie is a very regular to this dotNet newsgroup he helps often.
Cor
Hi Jeff,
Tx for your reply.
I am trying to take a table within a dataset and get it into a comma
delimited .txt file. If I try to do this with a stream or textstream using,
say, a 25000 row table, it takes quite some time. If I use the writexml
method, it's incredibly fast. So I thought - what if I first write it to
xml and then convert it? Ultimately, what I need is a comma delimited
textfile (.txt). Doing the same thing in .csv using interop and the Excel
object, it also takes far too long.
Thanks for any help.
Bernie
"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:eI**************@TK2MSFTNGP10.phx.gbl... "Bernie Yaeger" <be*****@cherwellinc.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
Is there a way to convert or copy a .xml file to a comma delimited text file using vb .net?
That's an extremely vague question. Could you provide more detail, specifically what the XML currently looks like and what you want the CSV
to look like?
Hi Cor,
Nice to hear from you again.
The answer is a document, but let me explain more thoroughly.
I am trying to take a table within a dataset and get it into a comma
delimited .txt file. If I try to do this with a stream or textstream using,
say, a 25000 row table, it takes quite some time. If I use the writexml
method, it's incredibly fast. So I thought - what if I first write it to
xml and then convert it? Ultimately, what I need is a comma delimited
textfile (.txt). Doing the same thing in .csv using interop and the Excel
object, it also takes far too long.
Thanks for any help.
Bernie
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... Hi Bernie,
A document or an dataset?
Cor
Is there a way to convert or copy a .xml file to a comma delimited text file using vb .net?
What about using XSLT on the xml that you have? I know XSL is notoriously
slow, but it still be a lot faster then just writing it and formatting it
manually.
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl... Hi Cor,
Nice to hear from you again.
The answer is a document, but let me explain more thoroughly.
I am trying to take a table within a dataset and get it into a comma delimited .txt file. If I try to do this with a stream or textstream
using, say, a 25000 row table, it takes quite some time. If I use the writexml method, it's incredibly fast. So I thought - what if I first write it to xml and then convert it? Ultimately, what I need is a comma delimited textfile (.txt). Doing the same thing in .csv using interop and the Excel object, it also takes far too long.
Thanks for any help.
Bernie "Cor Ligthert" <no**********@planet.nl> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... Hi Bernie,
A document or an dataset?
Cor
Is there a way to convert or copy a .xml file to a comma delimited
text file using vb .net?
Hi Marina,
Tx for your response. I'll try it.
Tx again,
Bernie
"Marina" <so*****@nospam.com> wrote in message
news:O3****************@TK2MSFTNGP10.phx.gbl... What about using XSLT on the xml that you have? I know XSL is notoriously slow, but it still be a lot faster then just writing it and formatting it manually.
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message news:%2***************@TK2MSFTNGP09.phx.gbl... Hi Cor,
Nice to hear from you again.
The answer is a document, but let me explain more thoroughly.
I am trying to take a table within a dataset and get it into a comma delimited .txt file. If I try to do this with a stream or textstream using, say, a 25000 row table, it takes quite some time. If I use the writexml method, it's incredibly fast. So I thought - what if I first write it
to xml and then convert it? Ultimately, what I need is a comma delimited textfile (.txt). Doing the same thing in .csv using interop and the
Excel object, it also takes far too long.
Thanks for any help.
Bernie "Cor Ligthert" <no**********@planet.nl> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... Hi Bernie,
A document or an dataset?
Cor
> Is there a way to convert or copy a .xml file to a comma delimited text file > using vb .net? >
Hi Bernie,
Now I do not understand it anymore, you want to write a table and than read
it
Here is my sample. See what you can do with it.
\\\\
Dim sw As New IO.StreamWriter("C:\Bernie.csv")
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
Dim row As New System.Text.StringBuilder
row.Append("""")
For y As Integer = 0 To ds.Tables(0).Columns.Count - 1
row.Append(ds.Tables(0).Rows(i)(y).tostring)
If y <> ds.Tables(0).Columns.Count - 1 Then
row.Append(""",""")
' if you want it with a tab
' row.Append("""")
' row.Append(chr(09))
' row.Append("""")
Else
row.Append("""")
End If
Next
sw.WriteLine(row.ToString)
Next
sw.Flush()
sw.Close()
///
Hi Cor,
Thanks for the sample - I'll give it a try!
Bernie
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:Or*************@TK2MSFTNGP11.phx.gbl... Hi Bernie,
Now I do not understand it anymore, you want to write a table and than
read it
Here is my sample. See what you can do with it. \\\\ Dim sw As New IO.StreamWriter("C:\Bernie.csv") For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 Dim row As New System.Text.StringBuilder row.Append("""") For y As Integer = 0 To ds.Tables(0).Columns.Count - 1 row.Append(ds.Tables(0).Rows(i)(y).tostring) If y <> ds.Tables(0).Columns.Count - 1 Then row.Append(""",""") ' if you want it with a tab ' row.Append("""") ' row.Append(chr(09)) ' row.Append("""") Else row.Append("""") End If Next sw.WriteLine(row.ToString) Next sw.Flush() sw.Close() ///
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Arne |
last post by:
From: "Arne de Booij" <a_de_booij@hotmail.com>
Subject: Comma delimited array into DB problems
Date: 9. februar 2004 10:39
Hi,
I have an asp page that takes input from a form on the previous...
|
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: Bernie Yaeger |
last post by:
Is there a way to convert a .xml file to a comma delimited text file using
vb .net?
Thanks for any help.
Bernie Yaeger
|
by: DCM Fan |
last post by:
Access 2K, SP3 on Windows 2K, SP4
All,
I have an import spec set up with quoted Identifiers and comma-separated
values. The text file is produced by a 3rd-party program of which I have no...
|
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: Kenneth Koski |
last post by:
Hello All,
I have a comma delimited text file, which I would like to move into a
SQL 2000 table . I created a DTS package in SQL Server and saved it as a
VB.bas . I am writting the code in C#...
|
by: Yama |
last post by:
Hi,
I am looking to create a report comma delimited on a click of a button.
Explanantion:
1. Get from the database: "SELECT * FROM Customers WHERE Region = 'CA'"
2. Use either DataReader or...
|
by: Avi |
last post by:
I need to create a text file that has the data from the 10 tables in
the database. The number of fields in the tables exceeds 255 and so I
cannot make a new table with all the fields and then...
|
by: JustSomeGuy |
last post by:
Hi. I have a comma delimited text file that I want to parse.
I was going to use fscanf from the C library but as my app is written
in C++
I thought I'd use the std io stream library...
My Text...
|
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: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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: 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...
| |