What file format can I use to output a formatted text file straight from a program without having the markup be too complicated?

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2011-01-15T22:35:46Z Indexed on 2011/01/15 22:53 UTC
Read the original article Hit count: 238

Filed under:
|
|

Premise:

I am parsing a file that is quite nearly XML, but not quite. From this file I would like to extract data and output in a file that a user could open up in some program and read. To make the data reasonable, I would almost certainly need to format the text. In case it matters, I will probably be using Java to write the program.

Problem:

I cannot find a file format that supports formatting without having terribly complex rules and encoding problems.

Attempts:

  • I looked into a basic .txt extension first, but it does not have enough formatting advantage.
  • I then tried a .rtf extension, but the rules for outputting text seem to be terribly complicated.
  • It was then suggested that I used XML, but I do not understand how this file would be viewed. This appears to be probably the best solution, but I don't understand much about it. Perhaps somebody could shed some light here.

In Other Words:

Could somebody suggest and easy to use file format and/or shed some light on how to use XML for text formatting and viewing?

© Stack Overflow or respective owner

Related posts about java

Related posts about file-io