This discussion is archived
10 Replies Latest reply: Jun 30, 2008 8:31 AM by 807589 RSS

Formatted output to a file.. need help

807589 Newbie
Currently Being Moderated
Hi,

I need to print to a file in a specified format..
The file should have 3 columns
1. Name 2. Age 3. Country

Every column should be of fixed length..

if i use out.println(name+"\t"+age+"\t"+Country); where out is a PrintWriter object
the output will come like this

Shaun Pollock 35 South Africa
Styris 32 Newzealand

It's not well aligned. I need each coumn should be of fixed length regardless of the name, age, country that is written to the file.

Please some one help..