473,385 Members | 1,342 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,385 software developers and data experts.

Convert excel file to xml

Hi experts ,
I have an excel file in the below format

---------------------------------------------------------------------
CodeID CodeName Market Name Date
--------------------------------------------------------------------

1 Sample1 Market1 22/2/2004
--------------------------------------------------------------------
2 Sample2 Market2 22/2/2003
--------------------------------------------------------------------

and so on..................

I want to convert this excel file in to the following xml format

<From Excel>
<CodeId>1</CodeId>
<CodeName>sample1</CodeName>
<MarketName>market1</MarketName>
<Date>22/2/2004</Date>
</From Excel>

<From Excel>
<CodeId>2</CodeId>
<CodeName>sample2</CodeName>
<MarketName>market2</MarketName>
<Date>22/2/2005</Date>
</From Excel>
and likewise all the selected cells from the excel file.I want to
implement it using c#.

Can anyone give the ideas (preferrably sample source code), helpfull
links so that I can do this task successfully.

Early ideas are greatly appreciated as I am stuck with this............

Regards
Jango

May 16 '06 #1
2 8496
Excell can export the data into XML format, you need to use VSTO/Automation
for this (googling to find samples of using Excel export and .NET), but the
schema of excell export may not suit you - you must decide how to cope with
this
There are several ways, but all based on XSLT transfomation
- use excell export to get xml file and then use XSLT to reformat xml
- use ADO/ODBC to connect to excell file, get data table and then convert
DataTable XML presentation into you own XML schema.

These ideas that just come into my mind. I'd use the second one.
Hi experts ,
I have an excel file in the below format

---------------------------------------------------------------------
CodeID CodeName Market Name Date
--------------------------------------------------------------------

1 Sample1 Market1 22/2/2004
--------------------------------------------------------------------
2 Sample2 Market2 22/2/2003
--------------------------------------------------------------------

and so on..................

I want to convert this excel file in to the following xml format

<From Excel>
<CodeId>1</CodeId>
<CodeName>sample1</CodeName>
<MarketName>market1</MarketName>
<Date>22/2/2004</Date>
</From Excel>

<From Excel>
<CodeId>2</CodeId>
<CodeName>sample2</CodeName>
<MarketName>market2</MarketName>
<Date>22/2/2005</Date>
</From Excel>
and likewise all the selected cells from the excel file.I want to
implement it using c#.

Can anyone give the ideas (preferrably sample source code), helpfull
links so that I can do this task successfully.

Early ideas are greatly appreciated as I am stuck with this............


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

May 16 '06 #2
Hi

Try this link.You might find it useful
http://www.codeproject.com/csharp/Excel2XML.asp

Regards
Naresh

"noopathan" wrote:
Hi experts ,
I have an excel file in the below format

---------------------------------------------------------------------
CodeID CodeName Market Name Date
--------------------------------------------------------------------

1 Sample1 Market1 22/2/2004
--------------------------------------------------------------------
2 Sample2 Market2 22/2/2003
--------------------------------------------------------------------

and so on..................

I want to convert this excel file in to the following xml format

<From Excel>
<CodeId>1</CodeId>
<CodeName>sample1</CodeName>
<MarketName>market1</MarketName>
<Date>22/2/2004</Date>
</From Excel>

<From Excel>
<CodeId>2</CodeId>
<CodeName>sample2</CodeName>
<MarketName>market2</MarketName>
<Date>22/2/2005</Date>
</From Excel>
and likewise all the selected cells from the excel file.I want to
implement it using c#.

Can anyone give the ideas (preferrably sample source code), helpfull
links so that I can do this task successfully.

Early ideas are greatly appreciated as I am stuck with this............

Regards
Jango

May 16 '06 #3

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

Similar topics

5
by: Andrew V. Romero | last post by:
At work we have an excel file that contains the list of medications and their corresponding strengths. I would like to save the excel file as a text list and paste this list into a javascript...
0
by: Alex | last post by:
i have a module in Access which opens an existing Excel file and envokes a macro within the Excel file to draw graphs. now i am trying to convert the Excel macro to an Access one so that the...
3
by: Steve | last post by:
Using VB.NET, How do I convert a .txt file extension to a .xls file extension? The text file is already created and saved in a folder on the server. Thanks Steven
8
by: pappu | last post by:
Hello friends, I want to convert .xls file into text file.So can anybody pls help me out. Thxxxxxx, Sachin.
3
by: Alain R. | last post by:
Hi, I have an excel file with charset "windows-1250" and i would like to convert it to CSV file with charset "UTF-8" how can i do that ? thanks a lot, Al.
2
budigila
by: budigila | last post by:
Hiya peeps, Okies, I have been trying to work this out for a while now to no avail... I am a beginner to this whole coding thing but have made great strides in my project. Basically what I am...
32
by: poolboi | last post by:
hi guys, i've read a lot of thread of converting excel data into CSV files. however, i need a perl script to convert CSV file into excel file now, if required modules is needed, it would be...
0
by: Raymond Chiu | last post by:
Dear all, In my vb.net program, I am using excel object to create excel file and stored in a folder. How can it be converted to be pdf file automatically using dotnet coding or others? Actually...
15
by: pakerly | last post by:
How would i do this, convert a test file to excel? Lets say my text file has fields like this: NUMBER NAME ADDRESS PHONE 11002 Test1 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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 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.