Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Databases _ HTML to excel worksheet where tag become column heaters

Posted by: HtmlKook Jan 16 2013, 06:25 PM

Hi everyone,

after much trying and search I am have to surrender and ask for help once more. I need to import data from a html file to excel. I have tried opening the file in excel and the web query, both methods work fine but the issue is the following: excel opens the file but recognises only two columns and displays the data in the two columns. What I need on the other hand is to delete the first row, and then use the first column to create column heaters and then fill in the data from column two below the appropriate column heaters.

Now my import looks like this

HD TEXT
WC TEXT
PD TEXT
SN TEXT
SC TEXT
LA TEXT
CY TEXT

HD TEXT
WC TEXT
PD TEXT
SN TEXT
LP TEXT
TD TEXT
RE TEXT

The spreadsheet after import should look something like this:

HD WC PD SN SC LA CY LP+TD RE PUB AN
TEXT TEXT TEXT TEXT TEXT TEXT TEXT etc
TEXT TEXT TEXT TEXT TEXT TEXT TEXT etc
TEXT TEXT TEXT TEXT TEXT TEXT TEXT etc

So basically I need to find all the unique column headers in and then fill the content corresponding to these heaters in the row below. I something like this at all possible?

I have also attached the html file for reference.

Any help or suggestions would be appreciated.

Kind regards,
HtmlKook


Attached File(s)
Attached File  Example.htm ( 248.29k ) Number of downloads: 2189

Posted by: Christian J Jan 16 2013, 07:51 PM

QUOTE(HtmlKook @ Jan 17 2013, 12:25 AM) *

excel opens the file but recognises only two columns and displays the data in the two columns.

That's how the web page's tables are arranged as well.

QUOTE
I something like this at all possible?

Possible but tedious. For a single web page you might create new HTML tables and paste the text into them manually (or do the same with Excel). If there are many more pages like this, there might be way to do it automatically (personally I've used javascript for cleaning up pages in a similar way).

OTOH you posted this in the Database forum. If you have access to the DB (or the server-side script that creates web pages from the DB query) you might be able to make it out the data in the form you like.

Posted by: HtmlKook Jan 23 2013, 11:02 PM

Thanks a lot Christian J.

Unfortunately, I do not have access to the back end of the database otherwise I am sure that there would be quite an easy solution.

There are actually a lot of html documents and copy and pasting is not a option.

I thought that it might be a tedious job and that some scripting might be involved but was just not sure if there were any readily available solutions. I am not a programmer so had to get someone who can write a script like this.

Thanks a again!


HtmlKook


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)