Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pica_add for PICA+ 237A$a #87

Closed
martinasiebert opened this issue May 24, 2023 · 2 comments
Closed

pica_add for PICA+ 237A$a #87

martinasiebert opened this issue May 24, 2023 · 2 comments
Labels

Comments

@martinasiebert
Copy link

catmandu fix for conversion to PICA seems not to know about that PICA field when using pica_add

@nichtich nichtich added the bug label May 25, 2023
@nichtich
Copy link
Member

Confirmed test:

echo '{"x":1,"record":[["012X","","x","a"]]}' | catmandu convert JSON to PICA --fix 'pica_add(x,237X$a)'

@nichtich
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants