Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write and read excel file

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to write and read from text file in java.
is it same as write to Excel file?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No--Excel files aren't text.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the way i am going to write a text to in java


if i need to write this text to Excel file how to do this?



 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4251
227
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should use something like Apache POI.
 
Rob Spoor
Sheriff
Pie
Posts: 20492
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a library for it. Apache POI and JExcelApi are the best known libraries for Excel. See also AccessingFileFormats.
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is common to import data into excel from a comma-separated (.csv) file.
Just write your data in a regular pattern with a comma between each field.
Excel will also recognize a different delimiter on import. I like to use the
pipe symbol "|" because it doesn't appear very often in text data.

Jim ... ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic