Forums Register Login

Writing to a file in a specific format??

+Pie Number of slices to send: Send
Hi,

I want to create a text file in a particular format using java..
for e.g

Labelxxxx Labelyyyy Label zzzzz
detail1 detail11 detail111
detail2 detail22 detail222
............

like a tabular format..

So how i can i do that??


Thanks,
Jignesh
+Pie Number of slices to send: Send
The java.io.FileWriter class can be used for writing characters to a file. For each value to print, convert it to a String, determine how many characters that has, and fill it up with spaces until it's as wide as the column it's in. With Java 5 you could also use the sprintf facility for formatted printing.
What's wrong? Where are you going? Stop! Read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 898 times.
Similar Threads
how to convert PPT file to XML file
PDF with java
Text file xls to Binary format xls in Java.
persistent suncertify.properties
jsp
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:35:30.