xmlstarlet sel on large file

前端 未结 2 1918
忘掉有多难
忘掉有多难 2020-12-16 23:26

The command

$ xmlstarlet sel -t -c \"/collection/record\" file.xml

seems to load the whole file into memory, before applying the given Xpat

2条回答
  •  伪装坚强ぢ
    2020-12-17 00:05

    Since I only needed a tiny subset of XPath for large XML files, I actually implemented a little tool myself: xmlcutty.

    The example from my question could be written like this:

    $ xmlcutty -path /collection/record file.xml
    

提交回复
热议问题