Created
January 18, 2011 14:30
-
-
Save haoess/784493 to your computer and use it in GitHub Desktop.
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 | |
| xmlstarlet sel -N tei="http://www.tei-c.org/ns/1.0" -t -f -o " " -m "//tei:bibl[@type='source']/tei:title" -c "." -n pj10*/*Z.xml | perl -0777 -nE 's/xmlns="[^"]+"//g;s/\.\.\/database\/journals\/journals. xml/\&journals;/g;s/\s{2,}/ /g;s/([^>])\n/\1/g;s/xml\s/xml\n/g;s/\s(pj\d{3})/\n\1/g;print "$_\n"' | grep '\(pj\|jour"\)' | perl -nE 'chomp;if(/^pj/){$v=$_}else{$v{$v}++}; END { printf "%s: %d\n", $_, $v{$_} for sort { $v{$a} cmp $v{$b} } keys %v}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment