formal falsche ISBNs in 2009 verschieben

This commit is contained in:
Felix Lohmeier 2021-03-03 16:18:52 +01:00
parent c46e807d73
commit cfc75a81db
4 changed files with 30 additions and 1 deletions

View File

@ -125,6 +125,8 @@ tasks:
"$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/7100a.json > {{.LOG}}
- > # spec_B_T_04, spec_B_T_05: ISBN 2000
"$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/2000.json > {{.LOG}}
- > # spec_B_T_57: Formal falsche ISBNs in 2009 verschieben
"$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/2009.json > {{.LOG}}
- > # spec_B_T_04, spec_B_T_05: ISMN 2020
"$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/2020.json > {{.LOG}}
- > # spec_B_T_29: ISSN 2010

View File

@ -0,0 +1,25 @@
[
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "record-based"
},
"baseColumnName": "2000",
"expression": "grel:forEach(value.split('␟'), isbn, if(isbn.length() == 10, if(with(round(sum(forRange(1,10,1,i,toNumber(isbn[i-1])*i))%11),x,if(x == 10, 'X', x)).toString() == isbn[9], null, isbn), if(isbn.length() == 13, if(((10-(sum(forRange(0,12,1,i,toNumber(isbn[i])*(1+(i%2*2)) )) %10)) %10).toString()[0] == isbn[12], null, isbn), null))).join('␟')",
"onError": "set-to-blank",
"newColumnName": "2009",
"columnInsertIndex": 4
{
"op": "core/text-transform",
"engineConfig": {
"facets": [],
"mode": "record-based"
},
"columnName": "2000",
"expression": "grel:forEach(value.split('␟'), isbn, if(isbn.length() == 10, if(with(round(sum(forRange(1,10,1,i,toNumber(isbn[i-1])*i))%11),x,if(x == 10, 'X', x)).toString() == isbn[9], isbn, null), if(isbn.length() == 13, if(((10-(sum(forRange(0,12,1,i,toNumber(isbn[i])*(1+(i%2*2)) )) %10)) %10).toString()[0] == isbn[12], isbn, null), null))).join('␟')",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10
}
]

View File

@ -19,6 +19,7 @@ with(
'1140',
'1500',
'2000',
'2009',
'2010',
'2020',
'2201',

View File

@ -8,9 +8,10 @@ if(row.index - row.record.fromRowIndex == 0,
+ forNonBlank(cells['0100'].value, v, '003@ ' + '0' + v + '\n', '')
+ forNonBlank(cells['0110'].value, v, '003S ' + '0' + v + '\n', '')
+ forNonBlank(cells['2000'].value, v, forEach(v.split('␟'),x,'004A ' + '0' + x + '\n').join(''), '')
+ forNonBlank(cells['2010'].value, v, '005A ' + '0' + v + '\n', '')
+ forNonBlank(cells['2009'].value, v, forEach(v.split('␟'),x,'004D ' + '0' + x + '\n').join(''), '')
+ forNonBlank(cells['2020'].value, v, '004F ' + '0' + v + '\n', '')
+ forNonBlank(cells['2201'].value, v, '004L ' + '0' + v + '\n', '')
+ forNonBlank(cells['2010'].value, v, '005A ' + '0' + v + '\n', '')
+ forNonBlank(cells['2199'].value, v, forEach(v.split('␟'),x,'006Y ' + '0' + x + '\n').join(''), '')
+ forNonBlank(cells['2240'].value, v, '007G ' + 'iZDB' + '0' + v + '\n', '')
+ forNonBlank(cells['1500'].value, v, '010@ ' + forEach(v.split('␟'),x,'a' + x).join('') + '\n', '')