Created
December 26, 2020 22:08
-
-
Save gingerbeardman/0d665dff0d400af913ced679810544bd to your computer and use it in GitHub Desktop.
ia upload script for EPOCH toy instruction manuals
This file contains 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
echo "identifier,file,description,subject,title,creator,mediatype,language" > epoch.csv | |
for file in *.pdf | |
do | |
# echo "Processing: $file" | |
id=`echo $file | awk '{print substr($0,1,5);exit}'` | |
en=`cat en.txt | grep $id` | |
trimmed_en=`echo "${en:8}"` | |
ja=`cat ja.txt | grep $id` | |
trimmed_ja=`echo "${ja:7}"` | |
prefix="epoch-manual-" | |
identifier=`echo "${trimmed_en//[()!\':+]/}"` | |
identifier=`echo "${identifier//&/and}"` | |
identifier=`echo "${identifier//\./ }"` | |
identifier=`echo "${identifier// - / }"` | |
identifier=`echo "$prefix${identifier//[ ・]/-}"` | |
identifier=`echo $identifier | tr '[:upper:]' '[:lower:]'` | |
echo "$identifier" | |
mediatype="texts" | |
title="$trimmed_en" | |
description="Instruction Manual for:<br><br>$trimmed_en<br>$trimmed_ja" | |
subject="epoch;toy;manual;instructions" | |
creator="EPOCH" | |
echo "$identifier,./$file,$description,$subject,$title,$creator,$mediatype,jpn" >> epoch.csv | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expects PDFs to be stored locally, with titles in two files ja.txt and en.txt