From 232c3ce637a0f46e44398b8f28c922135a88a0a4 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Wed, 12 Aug 2020 16:12:22 +0200 Subject: [PATCH] Haupttitel 4000 aus HST --- tasks/02-bibliotheca-main.sh | 42 ++++++++++++++++++++++++++++++++++++ tasks/03-ba-sachsen.sh | 1 + 2 files changed, 43 insertions(+) diff --git a/tasks/02-bibliotheca-main.sh b/tasks/02-bibliotheca-main.sh index a62e42b..d1de6cb 100755 --- a/tasks/02-bibliotheca-main.sh +++ b/tasks/02-bibliotheca-main.sh @@ -639,6 +639,47 @@ else fi echo +# --------------------------------- 15 4000 ---------------------------------- # + +# spec_B_T_17 +echo "Haupttitel 4000..." +if curl -fs \ + --data project="${projects[$p]}" \ + --data-urlencode "operations@-" \ + "${endpoint}/command/core/apply-operations$(refine_csrf)" > /dev/null \ + << "JSON" + [ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [ + { + "type": "text", + "name": "M|HST", + "columnName": "M|HST", + "query": "¬", + "mode": "text", + "caseSensitive": false, + "invert": false + } + ], + "mode": "row-based" + }, + "baseColumnName": "M|HST", + "expression": "grel:with(value.split('¬'), v, v[0].trim() + ' @' + v[1].trim())", + "onError": "set-to-blank", + "newColumnName": "4000", + "columnInsertIndex": 3 + } + ] +JSON +then + log "transformed ${p} (${projects[$p]})" +else + error "transform ${p} (${projects[$p]}) failed!" +fi +echo + # ================================== EXPORT ================================== # checkpoint "Export"; echo @@ -655,6 +696,7 @@ with( '0100', '0500', '2000', + '4000', '7100B', '7100f', '7100a', diff --git a/tasks/03-ba-sachsen.sh b/tasks/03-ba-sachsen.sh index b42fc8a..7b6d16c 100755 --- a/tasks/03-ba-sachsen.sh +++ b/tasks/03-ba-sachsen.sh @@ -477,6 +477,7 @@ if(row.index - row.record.fromRowIndex == 0, + forNonBlank(cells['0100'].value, v, '003@' + ' 0' + v + '\n', '') + forNonBlank(cells['2000'].value, v, forEach(v.split('␟'),x,'004A' + ' 0' + x + '\n').join(''), '') + forNonBlank(cells['2199'].value, v, '006Y' + ' 0' + v + '\n', '') ++ forNonBlank(cells['4000'].value, v, '021A' + ' a' + v + '\n', '') ,'') }}{{ if(isNonBlank(cells['7100f'].value),