Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jul 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Displaying whole HTML tables, properly formatted, and top-aligned with specific rows.

    I used to be a member of this forum long ago (its been more than a decade and I forget my old username) when it was known as Woody's Lounge. The folks here were always able to help with the unusual Excel or VBA questions and I hope that is still true because this is a really odd question.

    I am trying to extract some data from a website into a database and the software I am using allows export to MS Excel as a CSV file (technically a TabSV file). Most of the fields of the database are simple text or numbers but one field is a monster containing the entire HTML code for a single table (starting with the <TABLE> tag and ending with the </TABLE> tag). This table has complex multi-column and/or multi-row formatting and very unpredictable contents so I cannot *break-it down" into smaller fields.

    Below is a quick-and-dirty mockup of what I am trying to find out how to do. I want to convert the text data in column (E) to display visually like the table in column (F) but stay top-edge aligned with the rest of the data in the row. I need to be able to use the data tools to sort/filter the data and ensure that the correct table display stays with the correct row.

    #_046.jpg

    The HTML tables contain cumulative data for each client and they tend to get larger and more complex over time. My end-goal is to be able to sort the data by report date (column D) and then filter the data by ClientID (column B) and by looking for certain strings in the main content (column E) so that I can then scroll down and view the progressive changes in the report tables in chronological order.


    This is a personal research project (non profit) so low-to-no cost is desirable but any help or suggestions, even those using external utilities, are welcome. Thank you in advance. ~~ O.M.Y.

  2. #2
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,633
    Thanks
    115
    Thanked 646 Times in 590 Posts
    Can you post the entire CSV file?

  3. #3
    New Lounger
    Join Date
    Jul 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Quote Originally Posted by Maudibe View Post
    Can you post the entire CSV file?
    I'm afraid not. The contents of the client reports are available to me for my research under a confidentiality agreement and the complexity of the table data precludes doing any sort of data masking. I tried various ways to do masking but either the HTML kept getting corrupted or else everything inside HTML tags is untouched which leaves some confidential data exposed (the real client IDs are used as a part of the CSS selectors and sometimes the report "text" includes URL links which are embedded as anchor tags with HREF= elements).

    Ultimately I need to find or make a tool that can convert any HTML table into a correctly formatted output no matter how complex the table.

    My gut instinct tells me I will need to do my sort/filter on the existing data first and then follow that each time by invoking a VBA macro to dynamically create a report as a single HTML file for all the non-excluded rows. I am clueless on how to do this.

  4. #4
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,633
    Thanks
    115
    Thanked 646 Times in 590 Posts
    I believe this can be done with VBA that extracts the HTML coding from the CSV file by searching for table tags, wrapping them with HTML tags, and then creates an html file stored in the same directory as the CSV. The VBA code would then add a Microsoft Web Browser control to the same row in column F and import the table for display.

    If possible, can you copy just the HTML coding into a text file and post it?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •