From 1c5cda8e9ba0778ab84ea5f3f0c8e3fc7947f527 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Sun, 7 Feb 2021 22:20:36 +0100 Subject: [PATCH] Korrektur Ausgabe Barcode-Analyse --- Taskfile.yml | 2 +- barcode-analyse.sh | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100755 barcode-analyse.sh diff --git a/Taskfile.yml b/Taskfile.yml index 65ed86e..cb8b6f2 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -228,7 +228,7 @@ tasks: # Bearbeitungsstand - 'echo "Seit Juli 2019 neu hinzugekommene Dubletten: $(comm -13 input/duplicates-2019-07-10.txt output/barcodes/duplicates | wc -l)"' - 'echo "Seit Juli 2019 bearbeitete Dubletten: $(comm -23 input/duplicates-2019-07-10.txt output/barcodes/duplicates | wc -l)"' - - 'echo "Noch zu bearbeitende Dubletten: $(wc -l output/barcodes/duplicates)"' + - 'echo "Noch zu bearbeitende Dubletten: $(wc -l < output/barcodes/duplicates)"' # sources: # - input/* # generates: diff --git a/barcode-analyse.sh b/barcode-analyse.sh deleted file mode 100755 index e3d2f01..0000000 --- a/barcode-analyse.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Ermitteln von Dubletten in Barcodes - -mkdir -p output output/barcodes - -# Bibliotheca Barcodes extrahieren -for f in input/*.imp; do - grep '^\*I BARCO ' "$f" | dos2unix | cut -c 10- > output/barcodes/"${f##*/}.txt" -done -# Alephino Barcodes extrahieren -for f in input/*-exemplare.txt; do - grep '^120 ' "$f" | cut -c 6- > output/barcodes/"${f##*/}.txt" -done - -# Dubletten ermitteln -sort output/barcodes/*.txt | uniq -d > output/barcodes/duplicates -(cd output/barcodes && for f in *.txt ; do - grep -FxH -f duplicates "$f" | sort | join -o 2.1 -t ':' -a1 -2 2 duplicates - | cut -d '.' -f 1 > "${f}".tmp -done) -paste output/barcodes/duplicates output/barcodes/*.tmp | awk -F $'\t' '{sub($1, "\"&\""); print}' > output/barcodes/duplicates.tsv && rm output/barcodes/*.tmp