如何将HTML表格转换为CSV? [英] How can I convert an HTML table to CSV?

查看:243
本文介绍了如何将HTML表格转换为CSV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将HTML表格(< table> )的内容转换为CSV格式?有没有图书馆或Linux程序这样做?这类似于Internet Explorer中的复制表,并将它们粘贴到Excel中。

How do I convert the contents of an HTML table (<table>) to CSV format? Is there a library or linux program that does this? This is similar to copy tables in Internet Explorer, and pasting them into Excel.

推荐答案

程序,但对于临时转换,您可以

This method is not really a library OR a program, but for ad hoc conversions you can


  • 将表格的HTML放置在 strong> something.xls

  • 使用电子表格打开

  • 将其另存为CSV。

  • put the HTML for a table in a text file called something.xls
  • open it with a spreadsheet
  • save it as CSV.

我知道这适用于Excel,我相信我已经用OpenOffice电子表格。

I know this works with Excel, and I believe I've done it with the OpenOffice spreadsheet.

但是你可能更喜欢Perl或Ruby脚本...

But you probably would prefer a Perl or Ruby script...

这篇关于如何将HTML表格转换为CSV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆