for f in *; do echo $f; cat ../IATI-Registry-Refresher/ckan/$f | grep -oE '\{[^}]*publisher_iati_id[^}]*\}' | sed -e 's/.*"value": "\\"//' -e 's/\\".*//' | head -n 1; xmllint --xpath "//reporting-org/@ref" $f/* | sed 's/ \?ref="/\n/g' | sed 's/"$//' | tail -n +2 | sort | uniq -c; done > reporting-orgs