By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,918 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

How to read data from text file and write to Excel file using java code?

P: 1
read and write data from text to excel
Jul 2 '15 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 785
Reading data from a text file should be an easy exercise for you. You can find a lot of solutions in this forum. I also posted one several years ago here.

The more difficult part is how to save it in a way that Excel can read.

You can write it as text file in CSV format. That means, all values are separated by commas and quoted. Excel can import CSV without any problems.

If you need more (inserting formulas, formatting cells etc.) then you can use the apache POI interface (google for it) to write the binary data. Or you write it as text file in new Office Open XML format, which can be read in only by newer Excel versions.
Jul 2 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.