• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Flat File to XML

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could nebody suggest how would I go about converting a flat file (plain text, delimited file) into a XML Document?...
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its possible with java or any programming language. The structure of the xml document depends on ur system requirement.
You can aslo try to use xmlspy ,which could convert a delimted text file in to xml.
Is that what u r looking for ?
 
deep venu
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I am trying to write a custom code (in java)
to convert a delimited flat file into a XML file. I wouldn't go for a tool like XML Spy or XMl convert unless its too much of an ordeal to write custome code. If you got a sample code or something which you can share it would be gr8...
thanx...
 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aside from just reading the flat file in and using a StringTokenizer to break up the words and manually construct the XML, you can use a custom SAX parser that reads the flat file in, applies an XSL stylesheet as the file is read in, which transforms the "events" into XML.
I haven't done this, but i've just read about it. I'm trying to remember where I read it, if you research it a little you can probably find out more about it.
Brian
 
reply
    Bookmark Topic Watch Topic
  • New Topic