Created
February 18, 2019 03:35
-
-
Save horaciod/fc5f2a67149cf3a16a6d519854c95a2e to your computer and use it in GitHub Desktop.
extracción de url y nombre de revistas de un directorio repleto de xmls resultado de una cosecha OAI/PMH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "" >/tmp/titulos.txt | |
| echo "">/tmp/url.txt | |
| for file in *.xml | |
| do | |
| xmlstarlet sel -t -m '//dc:source[1]' -v . -n < ${file} >>/tmp/titulos.txt | |
| xmlstarlet sel -t -m '//dc:identifier[1]' -v . -n < ${file} >>/tmp/url.txt | |
| done | |
| cut -d ';' -f 1 < /tmp/titulos.txt |sort | uniq > titulosrevistas.txt | |
| cut -d '/' -f -6 < /tmp/url.txt |sort | uniq > urlrevistas.txt | |
| sed -i -- 's/article//g' urlrevistas.txt | |
| sed -i -- 's/view//g' urlrevistas.txt | |
| cat urlrevistas.txt | |
| cat titulosrevistas.txt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment