diff --git a/Taskfile.yml b/Taskfile.yml index cb8b6f2..6622689 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -215,8 +215,7 @@ tasks: # Alephino Barcodes extrahieren - for f in input/*-exemplare.txt; do grep '^120 ' "$f" | cut -c 6- | sort > "output/barcodes/$(f=${f##*/}; echo ${f%-*}).raw"; done # Extrahierte Barcodes gegen generiertes PICA+ abgleichen - - grep '209G/' output/03-ba-sachsen/ba-sachsen.pic | cut -c 14- | sort > output/barcodes/pica - - for f in output/barcodes/*.raw; do comm -12 "$f" output/barcodes/pica > "output/barcodes/$(f=${f##*/}; echo ${f%.*}).filtered"; done + - for f in output/barcodes/*.raw; do comm -12 "$f" <(sort output/03-ba-sachsen/barcodes.txt) > "output/barcodes/$(f=${f##*/}; echo ${f%.*}).filtered"; done # Plauen, Leipzig, Riesa vorübergehend nicht filtern - for f in leipzig riesa plauen; do cp output/barcodes/$f.raw output/barcodes/$f.filtered; done # Dublette Barcodes Gesamtdubletten ermitteln diff --git a/tasks/03-ba-sachsen.sh b/tasks/03-ba-sachsen.sh index d6eb2cb..b80cc26 100755 --- a/tasks/03-ba-sachsen.sh +++ b/tasks/03-ba-sachsen.sh @@ -529,6 +529,29 @@ echo # ------------------------- Dublette Barcodes löschen ------------------------ # # spec_Z_06 +format="txt" +echo "Dublette Barcodes exportieren" +IFS= read -r -d '' template << "TEMPLATE" +{{ +forNonBlank(cells['8200'].value, v, v + '\n', '') +}} +TEMPLATE +if echo "${template}" | head -c -2 | curl -fs \ + --data project="${projects[$p]}" \ + --data format="template" \ + --data prefix="" \ + --data suffix="" \ + --data separator="" \ + --data engine='{"facets":[],"mode":"row-based"}' \ + --data-urlencode template@- \ + "${endpoint}/command/core/export-rows" \ + > "${workdir}/barcodes.${format}" +then + log "exported ${p} (${projects[$p]}) to ${workdir}/barcodes.${format}" +else + error "export of ${p} (${projects[$p]}) failed!" +fi +echo echo "Dublette Barcodes löschen..." if curl -fs \ --data project="${projects[$p]}" \