473,226 Members | 1,385 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

Convert xml to csv

I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.

Please could some one assist with a possible better solution.

Thanks in advance
Jul 21 '05 #1
9 5219
> I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
Jul 21 '05 #2
> I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
Jul 21 '05 #3


"James Mahoney" wrote:
I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull

Connull
Jul 21 '05 #4


"James Mahoney" wrote:
I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull

Connull
Jul 21 '05 #5
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

Jul 21 '05 #6
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

Jul 21 '05 #7


"James Mahoney" wrote:
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

It would be appreciated. By the way, my xml document is viewable in Excel and I can also save the xml doc as xls. I unfortunately need the CSV as I need it in this format to import the data into another program. I thought there might be an easy way to use Excel's SaveAs option.

Connull

Jul 21 '05 #8


"James Mahoney" wrote:
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

It would be appreciated. By the way, my xml document is viewable in Excel and I can also save the xml doc as xls. I unfortunately need the CSV as I need it in this format to import the data into another program. I thought there might be an easy way to use Excel's SaveAs option.

Connull

Jul 21 '05 #9
I'm sure excel must have an import from XML option that will grab your XML
and add it to a work sheet. From there save as CSV should work.
Getting back to the XSL - my stylesheet would probably do more harm than
good. How are you getting your data out of the database - just as a dataset?

James

"Connull" wrote:


"James Mahoney" wrote:
> One simple way is to use a style sheet to transform the XML into CSV using
> XslTransform.
>
> I'm sure Excel has got some import options to import XML and turn it into a
> proper spreadsheet though
>
> James

If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

It would be appreciated. By the way, my xml document is viewable in Excel and I can also save the xml doc as xls. I unfortunately need the CSV as I need it in this format to import the data into another program. I thought there might be an easy way to use Excel's SaveAs option.

Connull

Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
1
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance...
4
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
3
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
7
by: patang | last post by:
I want to convert amount to words. Is there any funciton available? Example: $230.30 Two Hundred Thirty Dollars and 30/100
4
by: Edwin Knoppert | last post by:
In my code i use the text from a textbox and convert it to a double value. I was using Convert.ToDouble() but i'm used to convert comma to dot. This way i can assure the text is correct. However...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
6
by: Ken Fine | last post by:
This is a basic question. What is the difference between casting and using the Convert.ToXXX methods, from the standpoint of the compiler, in terms of performance, and in other ways? e.g. ...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.