jQuery in Action, 2nd edition*
The moose likes XML and Related Technologies and the fly likes Flat File to XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Flat File to XML" Watch "Flat File to XML" New topic
Author

Flat File to XML

deep venu
Ranch Hand

Joined: Jun 09, 2001
Posts: 56
Could nebody suggest how would I go about converting a flat file (plain text, delimited file) into a XML Document?...
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
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 ?


Spritle Software Blogs
deep venu
Ranch Hand

Joined: Jun 09, 2001
Posts: 56
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...
Brian Nice
Ranch Hand

Joined: Nov 02, 2000
Posts: 195
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Flat File to XML
 
Similar Threads
j2me address book
The earth
My Data over The network
XMl to flatfile conversion
WA #1.....word association