我已经xml2多次推荐该软件包。它是一个有用的工具,可以将合理格式良好的 XML 数据转换为面向行的格式,可以使用grep或awk等进行搜索以进行简单的提取。甚至使用2xml包中的相应程序进行简单的更改。
debian 包描述说:
Package: xml2
Source: xml2 (0.4-3.1)
Version: 0.4-3.1+b1
Installed-Size: 66
Maintainer: Patrick Schoenfeld <schoenfeld@debian.org>
Architecture: amd64
Depends: libc6 (>= 2.14), libxml2 (>= 2.7.4)
Description-en: Convert between XML, HTML, CSV and a line-oriented format
xml2 tools are used to convert XML, HTML and CSV to and from a
line-oriented format more amenable to processing by classic Unix
pipeline processing tools, like grep, sed, awk, cut, shell scripts,
and so …Run Code Online (Sandbox Code Playgroud)