XML related.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grayharmeet
    New Member
    • Nov 2008
    • 4

    XML related.

    Hi,

    I am fresher i have problem, who i can convert the text file into XML file formate. Please help me if you have any idea.

    Harmeet Singh
  • balabaster
    Recognized Expert Contributor
    • Mar 2007
    • 798

    #2
    Um... define "text file" and "xml format"...

    xml is syntactically very similar to html, except you can defined your own tags. What is the information in the text file you wish to have in XML?

    I'm going to assume you have the data in some kind of datatable style format in your text file - maybe csv or something... hopefully the first line has headers.

    In this case, just Google "load datatable from CSV". Once you have the data in a datatable you can just save the data out to an XML file using:

    Assuming you've successfully done this and you've created a DataTable called "MyDataTabl e", use the WriteXml method to save the data out to an XML file:

    C#
    Code:
    MyDataTable.WriteXml("MyOutputFile.xml");
    VB
    Code:
    MyDataTable.WriteXml("MyOutputFile.xml")

    Comment

    • grayharmeet
      New Member
      • Nov 2008
      • 4

      #3
      Hi,

      Thanks for reply. pls just give me details, how i can implement it my code.


      Harmeet Singh

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        You have already been given enough information to start writing your own code.

        Comment

        Working...