Menu

#111 Dealing with large file.

all
closed-wont-fix
nobody
None
5
2017-08-03
2015-07-22
Jak Wings
No

Can xmlstarlet deal with this large xml file?

http://download.wikipedia.com/zh_yuewiki/20150702/zh_yuewiki-20150702-pages-articles.xml.bz2

This command works:

xmlstarlet sel -t -c '/' zh_yuewiki-20150702-pages-meta-current.xml >output.xml

This fails:

xmlstarlet sel -t -c '//title' zh_yuewiki-20150702-pages-meta-current.xml >output.xml

Discussion

  • Noam Postavsky

    Noam Postavsky - 2015-07-23

    When you say "fails", what happens exactly?

    The sel command basically runs some XSLT on the input. You can see the XSLT code with xmlstarlet sel -C -t .... You could use this same XSLT with some other engine that deals better with large files.

     
    • Jak Wings

      Jak Wings - 2015-07-24

      It crash without printing anything. The exit code is 1.

      That's a pitty. Anyway, thanks for providing the solution.

       
  • Noam Postavsky

    Noam Postavsky - 2017-08-03
    • status: open --> closed-wont-fix
     

Log in to post a comment.