formatting output to text file

Hi,

I need some help with formatting the output to a file. Is there a way we can change the size or font of the text written to a text file?

Also can we set the line length (for eg. 80 characters).

I want to ouput description and amount king of stuff how do i achieve uniformity in the output.

I am using FileWriter or BufferedWriter to write the contents of the file.

The output i am looking for is in the following format

Desciprtion Amount

1.XXXXXXXXXXXXX$nn,nnn.nn

2.XXXXX $nn,nnn.nn

Thanks

vir

[581 byte] By [virenn] at [2007-9-26 1:34:10]
# 1

> Is there a way we can change the size or font of the

> text written to a text file?

Not before you define "text file"... For me a text file means a file that consists of mostly text (=letters and numbers). If the text should contain formatting like font size it doesn't really fit in this category anymore.

You can write as many characters per line as you want.

The format

1.XXXXXXXXXXXXX $nn,nnn.nn

2.XXXXX $nn,nnn.nn

is easily achieved - line number, period, text, space, and a formatted number. Something like

1. XXXXXXXXXXXXX $nn,nnn.nn

2. XXXXX$nn,nnn.nn

is a lot more trickier unless you know how long the description can be in maximum.

jsalonen at 2007-6-29 2:16:55 > top of Java-index,Archived Forums,Java Programming...
# 2
A text file (as in ASCII) does not have any font size/width (you could set line width and output return after every n chars.If you output as XML/HTML you could then add in font commands as is<FONT name="Lucida" size="5">Text</FONT>
markee1 at 2007-6-29 2:16:55 > top of Java-index,Archived Forums,Java Programming...
# 3
Nooooo.... do people still use those horrible things?!!?
jsalonen at 2007-6-29 2:16:55 > top of Java-index,Archived Forums,Java Programming...
# 4
Thanks guys!
virenn at 2007-6-29 2:16:55 > top of Java-index,Archived Forums,Java Programming...