Answer the question
In order to leave comments, you need to log in
Find data in bash files?
Good afternoon in bash is almost zero +, I have many different subdirectories with different names, but each of them has 123.xml with data of the same type.
How can I find the parameters of the uid data name type I need from all the 123.xml that are in the directories and write them all in turn to the file?
Tell me please?
UPD. Thanks for answers. The farther into the forest, the angrier the partisans. Much cleared up but not quite.
As a result, I came to the conclusion that I need to pull this out of all these *document.xml and in that order
grep -h -r xdms:number */*document.xml&grep -h -r xdms:date */*document.xml&grep -h -r xdms:header */*document.xml
<xdms:header xdms:type="��������" xdms:uid="197C0D87-15CD-4019-B7B0-ED101EDC75A1" xdms:created="2020-07-14T12:18:04.023">
</xdms:header>
<xdms:date>2020-07-10</xdms:date>
<xdms:number>А26-6666</xdms:number>
<xdms:date>2020-07-10</xdms:date>
<xdms:number>А26-20-НО-77039231-СО1</xdms:number>
<xdms:header xdms:type="��������" xdms:uid="066677AA-EB8B-45FB-A4CD-99B2D2239F33" xdms:created="2020-07-14T12:18:04.353">
</xdms:header>
<xdms:header xdms:type="��������" xdms:uid="51429AE7-3A66-4713-804B-82FB8D760731" xdms:created="2020-07-14T12:18:04.417">
</xdms:header>
<xdms:number>А26-2222</xdms:number>
<xdms:date>2020-07-10</xdms:date>
<xdms:date>2020-07-10</xdms:date>
<xdms:number>А26-20-НО-77039231-СО1</xdms:number>
<xdms:header xdms:type="��������" xdms:uid="EA50943C-AA47-4978-A5C9-A6A6583EF65C" xdms:created="2020-07-14T12:18:04.563">
</xdms:header>
<xdms:header xdms:type="��������" xdms:uid="22331428-64B9-40E7-A6E0-A4A488280C9D" xdms:created="2020-07-14T14:41:31.613">
</xdms:header>
<xdms:date>2020-07-10</xdms:date>
<xdms:date>2020-07-10</xdms:date>
<xdms:number>А26-7777</xdms:number>
<xdms:number>А26-20-НО-77039231-СО1</xdms:number>
Answer the question
In order to leave comments, you need to log in
grep -oP 'xdms:document.*uid="\K[0-9A-F-]*' */*document.xml | tr '\n' ';'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question