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

add instruction for how to merge >1 json? #42

Open
jayoung opened this issue Jan 14, 2023 · 0 comments
Open

add instruction for how to merge >1 json? #42

jayoung opened this issue Jan 14, 2023 · 0 comments

Comments

@jayoung
Copy link
Contributor

jayoung commented Jan 14, 2023

One thing it took me a minute to figure out is what to do when I have >1 json file. We need to concatenate them for validation (the workflow submission allows you to upload >1 json, but the validation doesn't)

Here's a note I wrote for myself. Could maybe add something like this somewhere in WDL101. Not sure where the best spot for it would be.

To merge two or more json files from the command line, we can use jq

jq -s '.[0] * .[1]' file1.json file2.json > combined.json
jq -s '.[0] * .[1] * .[2]' file1.json file2.json file3.json > combined.json

Maybe there's a better way - I would hope there's a more generalized solution where you don't need to mess with the bit in quotes when you change the number of files you're merging.

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

No branches or pull requests

1 participant