Forums Register Login

Most portable format for data

+Pie Number of slices to send: Send
Hi just a quick question, what is the best way to store primitive types when writing to a file so that other programs can read/import the data? For example, excel or SPSS.

Cheers,
Emilio
+Pie Number of slices to send: Send
Emilio,
For Excel, a comma delimitted file is best.
+Pie Number of slices to send: Send
spss handles csv-files too.
+Pie Number of slices to send: Send
This is probably a dumb question but are CSV files written as char?
As in, if I want to store 123456 as an actual integer it would take 4 bytes, as opposed to 12 bytes to store the six characters...is that right? If so, then I must write the numbers and commas and end-of-line characters.

Thank you for your input. =)

Cheers,
+Pie Number of slices to send: Send
Why not create a file in Excel and see how it saves it? You'll find, I think, that ultimately you have to write numbers in human-readable format. So I'd be going with a PrintWriter.


-Tim
+Pie Number of slices to send: Send
CSV files are in a plain text human-readable format, so you would output all 6 characters.
Water proof donuts! Eat them while reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1073 times.
Similar Threads
wordings for error message
JTree and JTable
RMI error
JComboBox Problem...Help
PrintWriter vs OutputStream
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:55:39.