2

Is there an HTML parser or some library that automatically converts HTML tables into CSV data rows?

Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
wefwgeweg
  • 1,359
  • 3
  • 11
  • 15

3 Answers3

2

Here is some perl script. And online converter (java needed). Or you can just manually copy HTML table from browser to OpenOffice Calc / MS Excel and save it as CSV - this will work too.

And here you are step-by-step solution on PHP.

Community
  • 1
  • 1
deklin
  • 238
  • 1
  • 3
1

sed s/'<td>'//g d1.txt | sed s/'<\/td>'//g | sed s/'<\/a>'/'<\/a>,'/g | sed s/'<\/em>'/'<\/em>,'/g | sed s/'<tr>'/'<br>'/g | sed s/'<\/tr>'//g | sed s/'<th>'/'<b>'/g | sed s/'<\/th>'/'| <\/b>'/g> names1.html

Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
1

you can try this simple PHP script (also as online converter) http://www.scherello.de/?id=243

M.S.
  • 11
  • 1