Link to home
Start Free TrialLog in
Avatar of eirikur
eirikur

asked on

Converting HTML table in CSV

Hi,

I'm searching for an easy and quick way to convert a HTML file containing a table with i.e. data written like this (i shortened the code a little ;)  to a CSV file:

<table>

<tr>
<td>Title 1</td>
<td>Amount 1</td>
</tr>

<tr>
<td>Title 2</td>
<td>Amount 2</td>
</tr>

etc...

</table>

Thank you for helping.
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Well, you are not going to be able to do it with just HTML code, you are going to
have to use a real programming language to do it. Take a look at the javascript
code here:

http://www.laurenceholbrook.com/TechnicalInformation/JavaScript_DOM_Excel_AutoFit_Graph_CSV.html

ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jenniferDA
jenniferDA

If you don't need a programmatic way of doing this, you can just select all the text in the table as it's rendered in the browser and paste it into Excel.  Then save as a CSV file.
I load the page into firefox, select all, paste the page into my favorite editor (textpad.com) and change all \t to ; with the regexp checkbox checked.
Save as csv and voila. If your excel can use tab-delimited csv, you can skip the change \t to ;

Michel