File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String to XML - converting space-delimited tabular text into XML

 
RNivas
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to develop a Java Component which will read a text file and will provide output as XML object/file.

Text string from file will contain space-delimited tabular text e.g.


COUNTRY/CO : PRODUCT: WINNERS: PRICE: DATES
--------------------------------------------------------------
CPC/TW: 950 KB Zafiro: ExxonMobil: NA 21-22 Nov
950 KB Zafiro: ExxonMobil: NA 25-26 Nov
PETECHIM/VN: Bunga Kekwa: below Tapis APPI -$/bl Nov
CPC/TW: Qatar Marine: major: premium to QP Nov
: Qatar Marine: NA: premium to QP Nov
===============================================================
== b = buys s = sells Check results on[CRU/AT1]
================================================================

//OR

Cash Spot Cash Tom Tom Next
------------------------------------------------------------
TIME Bid/Ask Bid/Ask Bid/Ask
(in IST)
1000 0.65/0.70 0.12/0.15 0.20/0.25
1.07% 0.99% 0.41%
(Closing Oct 5)
1000 0.20/0.25 0.10/0.15 0.10/0.15
0.82% 0.82% 0.82%
-----------------------------------------------------------





All I need is to capture this text in form of XML and then can present as HTML table.

Any idea.....?

Thanks & Regards
[ October 20, 2005: Message edited by: RNivas ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried? What is the problem?
 
JuanP barbancho
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

See for example a CVS to XML example is similar to TAB.

Java -XML by Orelly
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic