Forum Moderators: open

Message Too Old, No Replies

Converting HTML to Excel

         

mr_nabo

3:21 pm on Jul 15, 2008 (gmt 0)

10+ Year Member



Hi,

I'm sure this is a simple process, but is there a way of converting html tables into a .csv file or excel file?

I thought about trying to write a script, but thought there might be an easier way already out there.

Thanks

Trace

6:56 pm on Jul 15, 2008 (gmt 0)

10+ Year Member



You don't need to anything. Excel interprets HTML tables just fine on it's own. Simply open the HTML file up with Excel 97 or greater.

piatkow

9:03 am on Jul 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can open an html file in Word or Excel and a variety of other word processors and spreadsheets as well.

We output a lot of reports as html files giving the user the option to view them in a browser, Word or Excel. It removes the need for us to do extensive retesting of files when the target application is upgraded and we don't need to create duplicates of the same report for different environments.

mr_nabo

10:30 am on Jul 16, 2008 (gmt 0)

10+ Year Member



Ok, I was being stupid, thanks for pointing it out.

The reason I wanted to do this was to import a table of contacts created by some survey software. The problem I have now is that I have the email address in one column and the full name in another but I also need to have columns with the first name and surname.

Is there going to be an easy way to do that? i.e. does Excel allow you to split cell contents into two columns, or will I have to write a script in something like PHP to do that?

I realise this isn't the original question, but if you guys know, you'd save me a lot of headaches.

piatkow

1:12 pm on Jul 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Excel has an extensive library of functions. In this case you need to combine FIND to get the position of the first blank character and RIGHT or LEFT to get the character strings on each side of that position.

I am assuming that the list of names is clean and well formatted of course. Odd entries like "Dr John Smith" or "Smith, John" will give you problems.

Nearly forgot, remember to convert the formulae to values when you have finished.