Skip to content

Instantly share code, notes, and snippets.

@scips
Created September 22, 2017 08:27
Show Gist options
  • Select an option

  • Save scips/b96cf911276724f56932ce47d98d8208 to your computer and use it in GitHub Desktop.

Select an option

Save scips/b96cf911276724f56932ce47d98d8208 to your computer and use it in GitHub Desktop.
#!/bin/bash
# count node
for i in `ls *brol*.xml`; do
xmllint --xpath 'count(//segmentation/segment)' ${i} >> temp.text;
echo " ${i}" >> temp.text;
done;
# concat multiple field matching some text
for i in `ls *LATROIS*xml`; do
xmllint --xpath 'concat(//maxEpisode[text()='0']/../titre/text(), "-", //maxEpisode[text()='0']/../genre/text())' ${i};
echo "";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment