How to grep a huge XML file?

I am trying to grep on an xml file that is 13 GB and I am getting this error below. Actually I need to grep for this pattern and define a string and transfer data from XML to excel file.

home/jale% zgrep -i "Forward Challenge Curly WUT" *filename*

      

grep: line too long

grep: line too long

+3


source to share


1 answer


Use an XML parser like XPATH instead of GREP. GREP is not designed to search XML files, but parsers.



XPath, an XML path language, is a query language for selecting nodes from an XML document. Additionally, XPath can be used to compute values ​​(such as strings, numbers, or booleans) from the content of an XML document. XPath was defined by the World Wide Web Consortium (W3C).

0


source







All Articles