469,306 Members | 1,881 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Java code to convert text files to xml

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.
Jul 20 '05 #1
3 8786
In article <61**************************@posting.google.com >,
ro***@alum.rpi.edu (mave) wrote:
: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.


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 =
--
Steve W. Jackson
Montgomery, Alabama
Jul 20 '05 #2
"Steve W. Jackson" <st***********@charter.net> wrote in message news:<st*********************************@news.fu-berlin.de>...
In article <61**************************@posting.google.com >,
ro***@alum.rpi.edu (mave) wrote:
: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.


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 =


Hi Steve,

Have you written something to build XML documents as you describe?

L
Jul 20 '05 #3
In article <f7*************************@posting.google.com> ,
lq****@univ.llu.edu wrote:
:"Steve W. Jackson" <st***********@charter.net> wrote in message
:news:<st*********************************@news.f u-berlin.de>...
:> In article <61**************************@posting.google.com >,
:> ro***@alum.rpi.edu (mave) wrote:
:>
:> >: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.
:>
:> 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 =
:
:Hi Steve,
:
:Have you written something to build XML documents as you describe?
:
:L


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 =
--
Steve W. Jackson
Montgomery, Alabama
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Danny | last post: by
reply views Thread by Chua Wen Ching | last post: by
10 posts views Thread by Jay | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.