Answer the question
In order to leave comments, you need to log in
How to search and display words in a string?
Good day, dear users!
I ask for help in solving such a problem:
There is a dump.xml file, where there are links to sites of interest to me (Many links).
The problem is that there are also not so much links, but also a bunch of other "uninteresting in my case" information.
I would like to "pull out" only the links themselves from the file, and I would like to do this with a simple tool - the Linux command line.
It's pretty simple, just write a regular expression and grep the file. But in my case the file consists of only one line. And all these links, as well as other information I do not need, are all in one line. Therefore, egrep is useless here, because in fact, it displays the contents of the entire file, because grep - displays a line that matches the pattern.
Maybe there is a special key in egrep (although I read man and did not find it), or another command is suitable for this task?
Answer the question
In order to leave comments, you need to log in
If this file is in xml format, you need to use an xpath query (or even an xslt transform) to retrieve the required information.
XML to process with regular expressions - mauvais ton and incorrectly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question