From 4084a80d5e7a366e07e49d13ee3b7b2887b0b4ac Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Fri, 29 Apr 2022 20:09:40 +0200 Subject: [PATCH] 4030 --- alephino/config/main/T_4030.json | 68 +++++++++++++++++++++++++++++++ alephino/config/main/template.txt | 1 + 2 files changed, 69 insertions(+) create mode 100644 alephino/config/main/T_4030.json diff --git a/alephino/config/main/T_4030.json b/alephino/config/main/T_4030.json new file mode 100644 index 0000000..edb154a --- /dev/null +++ b/alephino/config/main/T_4030.json @@ -0,0 +1,68 @@ +[ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [ + { + "type": "list", + "name": "M|IDN", + "expression": "isBlank(value)", + "columnName": "M|IDN", + "invert": false, + "omitBlank": false, + "omitError": false, + "selection": [ + { + "v": { + "v": false, + "l": "false" + } + } + ], + "selectBlank": false, + "selectError": false + } + ], + "mode": "row-based" + }, + "baseColumnName": "M|IDN", + "expression": "grel:[ forNonBlank(forEach(cells['M|410'].value.split(';'), v, '\u001fp' + v.trim()).join(''), x, x, '') + forNonBlank(forEach(cells['M|412'].value.split(';'), v, '\u001fn' + v.trim()).join(''), x, x, null), forNonBlank(forEach(cells['M|415'].value.split(';'), v, '\u001fp' + v.trim()).join(''), x, x, '') + forNonBlank(forEach(cells['M|417'].value.split(';'), v, '\u001fn' + v.trim()).join(''), x, x, null), forNonBlank(forEach(cells['M|418'].value.split('␟'), v, forEach(filter(v.split('\u001f'), f, 'agh'.contains(f[0])), sub, '\u001f' + sub[0].replace('a','p').replace('g','n') + sub.slice(1)).join('')).join('␟'), x, x, null), forNonBlank(forEach(cells['M|419'].value.split('␟'), v, forEach(filter(v.split('\u001f'), f, 'ab'.contains(f[0])), sub, if(sub[0] == 'a', forEach(sub.slice(1).split(';'), a, '\u001fp' + a.trim()).join(''), '\u001fn' + sub.slice(1) )).join('')).join('␟'), x, x, null) ].join('␟')", + "onError": "set-to-blank", + "newColumnName": "4030", + "columnInsertIndex": 3, + "description": "Create column 4030" + }, + { + "op": "core/text-transform", + "engineConfig": { + "facets": [ + { + "type": "list", + "name": "4030", + "expression": "isBlank(value)", + "columnName": "4030", + "invert": false, + "omitBlank": false, + "omitError": false, + "selection": [ + { + "v": { + "v": false, + "l": "false" + } + } + ], + "selectBlank": false, + "selectError": false + } + ], + "mode": "row-based" + }, + "columnName": "4030", + "expression": "grel:forEach(value.split('␟'), v, if(v[0,2] != '\u001fp', '\u001fp[Erscheinungsort nicht ermittelbar]' + v, v)).join('␟')", + "onError": "keep-original", + "repeat": false, + "repeatCount": 10, + "description": "Text transform on cells in column 4030" + } +] diff --git a/alephino/config/main/template.txt b/alephino/config/main/template.txt index 8646707..00f5a00 100644 --- a/alephino/config/main/template.txt +++ b/alephino/config/main/template.txt @@ -21,6 +21,7 @@ if(row.index - row.record.fromRowIndex == 0, + forNonBlank(cells['3110'].value, v, forEach(v.split('␟'), x, '029F ' + x + '\n').join(''), '') + forNonBlank(cells['4020'].value, v, '032@ ' + 'a' + v + '\n', '') + forNonBlank(cells['4026'].value, v, '035E ' + 'a' + v + '\n', '') ++ forNonBlank(cells['4030'].value, v, forEach(v.split('␟'), x, '033A ' + x + '\n').join(''), '') + forNonBlank(cells['4222'].value, v, '046M ' + 'a' + v + '\n', '') ,'') }}{{