Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

Using zsh and ace to pull metadata from epub using recursion [duplicate]

$
0
0

I'm trying to pull a bunch of metadata from a bunch of epubs. I'm on a Mac, using Ace by Daisy.

So far I have:

#!/bin/zshif [[ -e ./report.txt ]]; then      rm ./report.txtfititles=("ISBN" "Features")fields=("dc:identifier" "schema:accessibilityFeature")for file in $PWD/unprocessed/*do   filename=$file:t:r   report=$PWD/output/$filename/report.json   ace --outdir $PWD/output/$filename $file   mv $file $PWD/processed/   for ((i=1; i<=${#titles[@]}; i++))   do       echo -n "${titles[$i]}: " >> report.txt       cat $report | jq -r '."earl:testSubject".metadata."${fields[$i]}"'>> report.txt   donedone

When I run it, I get a lot of "null" back from the jq call. But if I run:

cat $report | jq -r '."earl:testSubject".metadata."dc:identifier"'>> report.txt

...this will return the data I expect. Do i need to construct the call differently?


Viewing all articles
Browse latest Browse all 657

Trending Articles