From 2b0807f91dbae8713f72b18e58e01f4490960261 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Wed, 30 Mar 2022 22:43:57 +0200 Subject: [PATCH] 4002 --- alephino/config/main/T_4002.json | 67 +++++++++++++++++++++++++++++++ alephino/config/main/template.txt | 1 + 2 files changed, 68 insertions(+) create mode 100644 alephino/config/main/T_4002.json diff --git a/alephino/config/main/T_4002.json b/alephino/config/main/T_4002.json new file mode 100644 index 0000000..76afc42 --- /dev/null +++ b/alephino/config/main/T_4002.json @@ -0,0 +1,67 @@ +[ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "baseColumnName": "M|340", + "expression": "grel:coalesce(cells['M|340'].value, cells['M|341'].value, cells['M|341a'].value) + forNonBlank(cells['M|343'].value, v, '\u001fd' + v, '')", + "onError": "set-to-blank", + "newColumnName": "4002", + "columnInsertIndex": 3, + "description": "Create column 4002" + }, + { + "op": "core/text-transform", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "columnName": "4002", + "expression": "grel:value + forNonBlank(cells['M|345'].value, v, '␟' + v, '') + forNonBlank(cells['M|347'].value, v, '\u001fd' + v, '')", + "onError": "keep-original", + "repeat": false, + "repeatCount": 10, + "description": "Text transform on cells in column 4002" + }, + { + "op": "core/text-transform", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "columnName": "4002", + "expression": "grel:value + forNonBlank(cells['M|349'].value, v, '␟' + v, '') + forNonBlank(cells['M|351'].value, v, '\u001fd' + v, '')", + "onError": "keep-original", + "repeat": false, + "repeatCount": 10, + "description": "Text transform on cells in column 4002" + }, + { + "op": "core/text-transform", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "columnName": "4002", + "expression": "grel:value.replace('¬', '')", + "onError": "keep-original", + "repeat": false, + "repeatCount": 10, + "description": "Text transform on cells in column 4002" + }, + { + "op": "core/text-transform", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "columnName": "4002", + "expression": "grel:forEach(value.split('␟'), v, with(['a', 'das', 'dem', 'den', 'der', 'des', 'die', 'ein', 'eine', 'einem', 'einen', 'einer', 'eines', 'the'], x, if(inArray(x, v.split(' ')[0].toLowercase()), v.split(' ')[0] + ' @' + v.split(' ').slice(1).join(' '), v))).join('␟')", + "onError": "keep-original", + "repeat": false, + "repeatCount": 10, + "description": "Text transform on cells in column 4002" + } +] diff --git a/alephino/config/main/template.txt b/alephino/config/main/template.txt index 2ffa2c2..13854ed 100644 --- a/alephino/config/main/template.txt +++ b/alephino/config/main/template.txt @@ -10,6 +10,7 @@ if(row.index - row.record.fromRowIndex == 0, + forNonBlank(cells['1140'].value, v, '013H ' + 'a' + v + '\n', '') + forNonBlank(cells['1700'].value, v, '019@ ' + forEach(v.split('‡'),x,'a' + x).join('') + '\n', '') + forNonBlank(cells['4000'].value, v, '021A ' + 'a' + v + '\n', '') ++ forNonBlank(cells['4002'].value, v, forEach(v.split('␟'), x, '021G ' + 'a' + x + '\n').join(''), '') + forNonBlank(cells['3210'].value, v, '022A/00 ' + 'a' + v + '\n', '') + forNonBlank(cells['3211'].value, v, '022A/01 ' + 'a' + v + '\n', '') + forNonBlank(cells['3260'].value, v, '027A ' + 'a' + v + '\n', '')