Forums Register Login

write to text file in tabular form

+Pie Number of slices to send: Send
Need help!
Any one knows how to write data to a text file in a tabular form.
E.g An table consisting of 7 rows and 8 cols that looks like the ordinary table created in microsoft Word
Don't want this (using '|' , '=' ,'-' characters to format table)

Thanks
+Pie Number of slices to send: Send
In a plain text file? Can't be done. MS Word uses a proprietory format to store information on the format and contents of a table. Unless you want to reverse-engineer their format. . .
Maybe generating an HTML file would be an option? Creating an HTML table is pretty easy and everyone has a browser.
+Pie Number of slices to send: Send
I know HTML but how to generate the HTML table from java?
+Pie Number of slices to send: Send
Supposed a table with 2 rows and 3 cols (to keep the example tiny).
Your output shall look like this: (Oh - I hope this UBB-thing will get it right)

With h1 meaning header column1, ...
vXY meaning value row X column Y
Perhaps we need a table-object?

You may iter over the rows, and inside the rows over the columns.
The ctor could be called with an Array for the header, and a two-dim String-Array for the values.
Good night. Drive safely. Here's a tiny ad for the road:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3659 times.
Similar Threads
JTextArea and saving to a file
Generating xsl to convert Xml into text format using transformation engine.
Reading a CSV file and storing it into an array and then displaying it on a HTML screen
Jasper Csv export : remove title and footer and remove wrap text
how to read a text file from a database table
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:29:43.