Export Barcodes für Barcode-Analyse

This commit is contained in:
Felix Lohmeier 2021-02-08 16:37:36 +01:00
parent 9a35fb37cf
commit b188267640
2 changed files with 24 additions and 2 deletions

View File

@ -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

View File

@ -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]}" \