News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Once upon a time, Internet Explorer could export a table to Excel

Started by jj2007, November 20, 2020, 12:03:27 PM

Previous topic - Next topic

jj2007

Once upon a time, Internet Explorer could export a table to Excel, and that was quite a handy function. However, after a security update in 2016, MSIE stopped doing so.

That bothered me a lot, because I frequently extract data from websites, so I decided to enhance NoTag$() a little bit:

include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init                                          ; extract only the table from the HTML file
  Let esi=NoTag$(FileRead$("https://www.tuttitalia.it/regioni/popolazione"), table)
  FileWrite "test.tab", esi
  ShEx "test.tab"               ; launch your default tab viewer
EndOfCode


Works like a charm, but not with all sites. Sometimes you need to save a page as e.g. test.html, then drag the file over the attached exe and the sample html file taken from the Forum stats. Occasionally, minor corrections are needed. Let me know if you know a page that fails miserably - it's work in progress :cool:

P.S.: There is a second issue that drove me nuts. Some pages use the 2.000,12 syntax instead of 2,000.12, and that is quite a nuisance with imports to Excel. If you have such a site, add a third argument swcd (swap commas and dots)