Closed martinasiebert closed 1 year ago
Confirmed test:
echo '{"x":1,"record":[["012X","","x","a"]]}' | catmandu convert JSON to PICA --fix 'pica_add(x,237X$a)'
It turns out, this is not a bug because 237A
is not 237A/00
but a shortcut for 237A/*
(all 237A
fields with any occurence). So this works for existing fields 237A/*
:
echo '{"x":1,"record":[["237X","01","x","a"]]}' | catmandu convert JSON to PICA --fix 'pica_add(x,237X$a)'
To add a new field, the occurrence must be known, e.g.
echo '{"x":1,"record":[["003@","","0","123"]]}' | catmandu convert JSON to PICA --fix 'pica_add(x,237X/01$a)'
By the way I just release 1.14 fixing #77, so after update this should also work.
echo '{"x":1}' | catmandu convert JSON to PICA --fix 'pica_add(x,237X/01$a)'
If further help is needed, please describe your use case!
catmandu fix for conversion to PICA seems not to know about that PICA field when using pica_add