Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

text file(not delimiter separated) to xml conversion.

 
Hemang Thanki
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to convert .txt file to .xml. This task looks so simple. But actually, the .txt file is not delimiter separated. I googled and found that if the file is delimiter separated, that can be done using simple java program(As Balaji replied in one of the topic in the XML forum).

Text file example:
==================
00000000000000000000000000000000000000000000000<b>3100</b> A 784784784CMCC C 2005-05-030000-002006-02-251958-11-1200 ENU 000000000 0000001 02 00000000015000002& &AYNIE
========================================================================
Now based on the position I need to extract the data. That is already done.
This data e.g. <b>3100</b>, needs to be the tag in the .xml file based on some condition. There could be nesting of tags possible. I know the position of the data.

Question: How do I convert this data to .xml? Is there any utility(jar) which helps me creating xml?

Thanks a ton in advance.

Regards,
Hemang
 
Hemang Thanki
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my previous query text file does not contain <b>3100</b>. It is only 3100.
Sorry for that.
 
Paul Clapham
Sheriff
Pie
Posts: 20953
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try reading this chapter:

http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html

and see if it helps.
 
Hemang Thanki
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Paul,
Thanks for the help.
Actually, I googled and found the castor is the proper answer for my query...

Thanks again...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic