Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to export an HTML file to .csv file

 
June
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know where I can get info about how to export an HTML file to .csv file?
For example, I create a webpage that has an export button or link... allowing user to export the current webpage to an .csv file to his/her machine.
Thanks a lot!!!
JQ
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming you mean that you want to export the information in a page as a CSV file, not the whole page with markup etc.- and that the goal is to generate data that can be read by Excel or some such application.
Your button can link to a servlet that generates CSV text instead of HTML, the main thing is that you will have to set the content type to match. For example, you might use the content type:
application/vnd.ms-excel
Is that what you had in mind?
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic