Sha256: 0855b0c5e8cd84e2958031f1bbfdab2de1cfcd729f1d7a241fbdca5aceb860f2
Contents?: true
Size: 663 Bytes
Versions: 9
Compression:
Stored size: 663 Bytes
Contents
#!/bin/bash # # Extracts a single mab/mabmapper xml file from a numbered archive # # Usage: # ./mab_by_docid.sh 000636652 (call this from within the directory where the archives are located) # # Dependencies: bash, sed, xmllint (from libxml) docid_with_zeros=$1 docid_without_zeros="$(echo $docid_with_zeros| sed 's/0*//')" archive_number="$(((docid_without_zeros/50000)+1))" archive_file_name=$(find . -name "aleph.PRIMO.*.$archive_number.tar.gz") mab_file_name="PAD01.$docid_with_zeros.PRIMO.xml" # grab the file from the tar.gz tar -xvzf $archive_file_name $mab_file_name # format output using xmllint xmllint --format $mab_file_name --output $mab_file_name
Version data entries
9 entries across 9 versions & 1 rubygems