【发布时间】:2016-03-13 05:11:57
【问题描述】:
我有一个 html 文件,其中包含我正在处理的项目的依赖项列表。格式如下:
-- 一些html
<p><strong>Module Name:</strong> spring-web</p>
<p><strong>Module Group:</strong> org.springframework</p>
<p><strong>Module Version:</strong> 4.2.1.RELEASE</p>
-- 更多html
<p><strong>Module Name:</strong> google-http-client</p>
<p><strong>Module Group:</strong> com.google.http-client</p>
<p><strong>Module Version:</strong> 1.19.0</p>
等
我想从这个 html 文件创建一个 csv 文件 csv 文件将具有每条记录的格式:
模块名称、模块组、模块版本
例如 google-http-client,com.google.http-client,1.19.0
知道如何用脚本做到这一点吗?
【问题讨论】:
-
使用 XML 解析器(xmlstarlet, xmllint, ...)。
标签: html bash csv unix scripting