ersetze .reverse()[0] durch [-1]

This commit is contained in:
Felix Lohmeier 2021-02-10 11:23:31 +01:00
parent 1c77a9ab50
commit 192bbef02d
3 changed files with 5 additions and 5 deletions

View File

@ -35,7 +35,7 @@
{
"type": "list",
"name": "id",
"expression": "grel:with(value.cross('muenster', columnName), rows, if(rows.length() > 1, if(rows.index.sort().reverse()[0] > row.index, 'is duplicate of a higher row number', 'has duplicate(s) with lower row number'), 'unique'))",
"expression": "grel:with(value.cross('muenster', columnName), rows, if(rows.length() > 1, if(rows.index.sort()[-1] > row.index, 'is duplicate of a higher row number', 'has duplicate(s) with lower row number'), 'unique'))",
"columnName": "id",
"invert": false,
"omitBlank": false,

View File

@ -26,10 +26,10 @@
"mode": "row-based"
},
"columnName": "mets:mets - mets:fileSec - mets:fileGrp - mets:file - ID",
"expression": "grel:'FILE_' + row.record.cells['id'].value[0].split(':').reverse()[0] + '_' + (row.index - row.record.fromRowIndex + 1)",
"expression": "grel:'FILE_' + row.record.cells['id'].value[0].split(':')[-1] + '_' + (row.index - row.record.fromRowIndex + 1)",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10,
"description": "Text transform on cells in column mets:mets - mets:fileSec - mets:fileGrp - mets:file - ID using expression grel:'FILE_' + row.record.cells['id'].value[0].split(':').reverse()[0] + '_' + (row.index - row.record.fromRowIndex + 1)"
"description": "Text transform on cells in column mets:mets - mets:fileSec - mets:fileGrp - mets:file - ID using expression grel:'FILE_' + row.record.cells['id'].value[0].split(':')[-1] + '_' + (row.index - row.record.fromRowIndex + 1)"
}
]

View File

@ -57,11 +57,11 @@
"mode": "row-based"
},
"columnName": "setSpec",
"expression": "grel:value.split(':').reverse()[0]",
"expression": "grel:value.split(':')[-1]",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10,
"description": "Text transform on cells in column setSpec using expression grel:value.split(':').reverse()[0]"
"description": "Text transform on cells in column setSpec using expression grel:value.split(':')[-1]"
},
{
"op": "core/text-transform",