tag:blogger.com,1999:blog-6692866151143183230.post3395880620782874064..comments2024-03-19T16:22:18.277+05:30Comments on jugad2 - Vasudev Ram on software innovation: Publish Microsoft Excel XLSX data to HTML with openpyxlVasudev Ramhttp://www.blogger.com/profile/13568740634188042591noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-6692866151143183230.post-28507719065804438972017-08-02T22:34:50.163+05:302017-08-02T22:34:50.163+05:30
Hi Dany,
The code worked fine for me.
If you ar...<br />Hi Dany,<br /><br />The code worked fine for me.<br /><br />If you are new to Python, you are likely to have other problems too - with any non-trivial code, not just with this one. So I suggest you 1) spend some time learning Python more, which will be beneficial in the long run too, not just for your current need, and 2) for now, for your need to convert spreadsheet to HTML, search for some utility that can do it for you without any programming knowledge. You can try Zamzar and other such sites.<br /><br />HTH.<br />Vasudev Ramhttps://www.blogger.com/profile/13568740634188042591noreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-16003955208786555222017-08-02T16:33:51.446+05:302017-08-02T16:33:51.446+05:30Hi Ram, New to python and tried the above code. bu...Hi Ram, New to python and tried the above code. but not able to locate correct places for double quotes..tried with as much as i know but no luck. can you pls correct and post the right code. Actually i just want to convert spreadsheet data into html. no headers/footers.<br /><br />Thanks in advance!!Anonymoushttps://www.blogger.com/profile/07375774693136177816noreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-58908696546288197052013-11-23T03:15:07.637+05:302013-11-23T03:15:07.637+05:30Interesting ... thanks.
Interesting ... thanks.<br />Vasudev Ramhttps://www.blogger.com/profile/13568740634188042591noreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-37814940343030212072013-11-23T02:09:12.500+05:302013-11-23T02:09:12.500+05:30Pandas is not that simple and the code is wrong as...Pandas is not that simple and the code is wrong as DataFrame does not have a read_excel function (at least in the current pandas version):<br /><br />import pandas<br />xd = pandas.ExcelFile('fruits.xlsx')<br />df = xd.xd.parse(xd.sheet_names[0], header=None, keep_default_na=False)<br />with open("fruits_pandas.html", "w") as html_fil:<br /> html_fil.write(df.to_html(header=False, index=False))<br /><br />Blog comments don't keep the python indenting so if anyone wants to use the code, make sure to put the block indenting back into the line following "with...html_fil:" section near the end of the code snippet.<br /><br />The only annoying thing with pandas is the to_html inserts a <border="1"... value which I could not find in the API definition how to remove it or change its value.PeterDnoreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-60118901591406998962013-11-21T22:36:06.143+05:302013-11-21T22:36:06.143+05:30Note to readers: Though I did replace the HTML ele...Note to readers: Though I did replace the HTML elements' angle brackets with the corresponding HTML entities (ampersand "lt" semicolon, ampersand "gt" semicolon, etc.) - in the Python code in the post, it got messed up in a few places. Make the obvious changes after looking at the code, and things will work.<br /><br />Vasudev Ramhttps://www.blogger.com/profile/13568740634188042591noreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-35180011283695370672013-11-21T21:50:23.802+05:302013-11-21T21:50:23.802+05:30Cool, thanks.
Cool, thanks.<br />Vasudev Ramhttps://www.blogger.com/profile/13568740634188042591noreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-24827123503123676552013-11-21T16:34:03.272+05:302013-11-21T16:34:03.272+05:30You can use the pandas library :
import pandas
df...You can use the pandas library :<br /><br />import pandas<br />df = pandas.DataFrame.read_excel('myfile.xlsx')<br />table = df.to_html()<br />Anonymoushttps://www.blogger.com/profile/14090812043483966453noreply@blogger.com