Table in HTML file

Hi everyone. I hope you are doing well.

Is there a solution to read different tables in a html file?

Thanks in advance.

Can you post a sample html file? With this we can check

I played a little:

With the top 2 transformation I loaded a table and exported it to html. (first try was with al cell populated with values.

In the middle row I tried one process reading in the data as xml. It works but only if all cells of the table hold values.

The bottom row reads data as plain text, cut of file heads and bottom part and reorder the values. Both solutions require analysis of the file and adaptations might be required in case of different layouts and data. It is not a general solution for different html formats.

HTML Table.transform (10.6 KB)

I would suggest in general a more pragmatic approach. Open the html file in a browser and mark the table, copy and paste it into EDT. In such case you can use Schema, too, to handle fields you don’t need or do have strange values.

2 Likes

Currently EDT can write, but not read, HTML.

We might add HTML input support at some point. However there is the complication that one HTML file can contain 0, 1 or many tables.

For now, you can either:

  • open the file in a browser, copy the paste and then add it From Clipboard; or
  • read it in as plain text and use Slice and Split Col to separate out the table
1 Like

Thank you, Olaf and Andy, for your replies.

In general, it would be great if EDT could detect all the tables in an HTML file (i.e., those enclosed within <table></table> tags) and read each of them as a separate data source, with one input per table.

In my specific case, however, things are a bit more complex. The attached file (It’s a HTML file. I renamed it as a txt file to be able to upload it) contains the results of a swimming competition covering multiple events and age categories. My goal is to transform this file into a single consolidated table by incorporating the information contained in the section headers—such as the distance, stroke, gender, age category (Minimes, Cadets, Juniors/Seniors), and stage (Séries or finales)—into each corresponding results table, as shown in the header of the image below.

I already have a Python script that does this, but I wanted to see if I could reproduce the same process using EDT.

Swimming.txt (1.5 MB)

That is on the wishlist. However HTML is a complex format and it isn’t a trivial thing to add.

1 Like