Is anyone aware of a Java program preferably w/ source code to convert files in text format to xml format?
Pls. let me know if you are aware of such a program.
Steve W. Jackson said:Not likely, since the details of the text format and the desired XML document structure are up to you. You just need to write something that reads the text file, since you know its structure, and builds the XML document the way you want it from the data, then writes it.
= Steve =
:> In article ,
> (mave) wrote:
>
> >:Is anyone aware of a Java program preferably w/ source code to convert
> >:files in text format to xml format?
> >:
> >:
> >ls. let me know if you are aware of such a program.
>
> Not likely, since the details of the text format and the desired XML
> document structure are up to you. You just need to write something that
> reads the text file, since you know its structure, and builds the XML ...
Not personally, but my coworker has done this. Our application does high end modeling and simulation, using XML documents for the saved model format. He worked on the previous incarnation of the application, which used a completely different (pure text) file structure. So he put together an "importer" that read the old file and put it into the appropriate structure for our application.
It's just a matter of deciding what the structure of your XML document should be and knowing what's in the text file. You create a new XML document with appropriate code in Java, then add/manipulate elements and attributes as needed to obtain the desired result.
= Steve =
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.