1

I have a html file which I want to write into an excel file. I thought the command I should put in my .bat file would be myfile.html > myfile.xls OR myfile.html >> myfile.xls

What it is doing is creating the file but when I open it is renamed correctly but blank in terms of content. the html file is just a massive table of data so surely it can just post it to the excel file correctly?

  • excel files are a little more complex than just a block of values, or a text file with a different extension (hence the difference from flat file formats like csv etc.) have a look at: http://stackoverflow.com/questions/15567086/generate-excel-sheet-from-html-tables-using-jquery – Lefty Dec 02 '14 at 14:53
  • @Lefty the thing is, for some reason it wont even work if I try and output to a text file like this. myfile.html > myfile.txt why is this? I just need to put it somewhere I can grep values –  Dec 02 '14 at 14:55
  • You're missing an action verb. In a Windows .bat you'll want to 'type myfile.html > myfile.xls', or more simply 'copy myfile.html myfile.xls'. That said, depending on the contents of your html file it's unlikely just a straight extension change will get you where you want to be. – swornabsent Dec 02 '14 at 14:57
  • @swornabsent i get the 'type' or 'copy' is not recognized as an internal/external command. although it does do it anway but again creates blank files –  Dec 02 '14 at 15:02
  • @swornabsent new plan, can you use "control+a" (Select all) or "control+c" (copy) in a command line script –  Dec 02 '14 at 15:13

1 Answers1

0

if the html page is in IE you can create a button at the end of table which on click executes a javascript and download table content in .xls using activeXobject or you can redirect to another jsp page where response type is set for excle.

rupesh
  • 39
  • 11