From 260419c75ae7b4fd86eb61b5778e52e4e8fd0ade Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Sat, 30 Apr 2022 19:27:58 +0200 Subject: [PATCH] 2000 --- alephino/config/main/T_2000.json | 48 +++++++++++++++++++++++++++++++ alephino/config/main/template.txt | 1 + 2 files changed, 49 insertions(+) create mode 100644 alephino/config/main/T_2000.json diff --git a/alephino/config/main/T_2000.json b/alephino/config/main/T_2000.json new file mode 100644 index 0000000..f0b96dc --- /dev/null +++ b/alephino/config/main/T_2000.json @@ -0,0 +1,48 @@ +[ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "baseColumnName": "M|540a", + "expression": "grel:[ value, cells['M|540'].value ].join('␟')", + "onError": "set-to-blank", + "newColumnName": "2000", + "columnInsertIndex": 3, + "description": "Create column 2000 at index 3 based on column M|540a using expression grel:[ value, cells['M|540'].value ].join('␟')" + }, + { + "op": "core/text-transform", + "engineConfig": { + "facets": [ + { + "type": "list", + "name": "2000", + "expression": "isBlank(value)", + "columnName": "2000", + "invert": false, + "omitBlank": false, + "omitError": false, + "selection": [ + { + "v": { + "v": false, + "l": "false" + } + } + ], + "selectBlank": false, + "selectError": false + } + ], + "mode": "row-based" + }, + "columnName": "2000", + "expression": "grel:forEach(value.split('␟'), v, forNonBlank(filter(v.split('\u001f'), f, f[0] == 'a')[0].slice(1), x, '\u001f0' + x.replace('-','').replace('x','X'), '') + forNonBlank(filter(v.split('\u001f'), f, f[0] == 'b')[0].slice(1), x, '\u001ff' + x, '') ).join('␟')", + "onError": "keep-original", + "repeat": false, + "repeatCount": 10, + "description": "Text transform on cells in column 2000" + } +] diff --git a/alephino/config/main/template.txt b/alephino/config/main/template.txt index 31ebe32..fee0c3e 100644 --- a/alephino/config/main/template.txt +++ b/alephino/config/main/template.txt @@ -2,6 +2,7 @@ if(row.index - row.record.fromRowIndex == 0, '' + '\n' + forNonBlank(cells['0500'].value, v, '002@ ' + '0' + v + '\n', '') ++ forNonBlank(cells['2000'].value, v, forEach(v.split('␟'), x, '004A ' + x + '\n').join(''), '') + forNonBlank(cells['2003'].value, v, forEach(v.split('␟'), x, '004P ' + '0' + x + '\n').join(''), '') + forNonBlank(cells['2199'].value, v, '006Y ' + '0' + v + '\n', '') + forNonBlank(cells['1500'].value, v, '010@ ' + forEach(v.split('‡'),x,'a' + x).join('') + '\n', '')