Skip to main content
https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths/460648
Source Link
peak
  • 119.1k
  • 21
  • 185
  • 218

You could start with the following command-line invocation:

jq -n "[inputs | .messages] | add" *.json 

This has a number of assumptions. If your windows shell does not support wildcard expansion, see Passing multiple wildcard filenames to a command in Windows and/or https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths/460648#460648

Other assumptions are that you are using jq 1.5 or later, and of course that all the *.json files in the current directory are relevant and that *.json lists them in the desired order.

If the ordering of the JSON files is best determined by explicitly listing them, then you will probably want to create a batch file. If their ordering is determined by their contents, then you could use jq to order them for you, but the details of how to do will depend on the details about the sorting criteria.

You could start with the following command-line invocation:

jq -n "[inputs | .messages] | add" *.json 

This has a number of assumptions. If your windows shell does not support wildcard expansion, see Passing multiple wildcard filenames to a command in Windows

Other assumptions are that you are using jq 1.5 or later, and of course that all the *.json files in the current directory are relevant and that *.json lists them in the desired order.

If the ordering of the JSON files is best determined by explicitly listing them, then you will probably want to create a batch file. If their ordering is determined by their contents, then you could use jq to order them for you, but the details of how to do will depend on the details about the sorting criteria.

You could start with the following command-line invocation:

jq -n "[inputs | .messages] | add" *.json 

This has a number of assumptions. If your windows shell does not support wildcard expansion, see Passing multiple wildcard filenames to a command in Windows and/or https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths/460648#460648

Other assumptions are that you are using jq 1.5 or later, and of course that all the *.json files in the current directory are relevant and that *.json lists them in the desired order.

If the ordering of the JSON files is best determined by explicitly listing them, then you will probably want to create a batch file. If their ordering is determined by their contents, then you could use jq to order them for you, but the details of how to do will depend on the details about the sorting criteria.

wildcards
Source Link
peak
  • 119.1k
  • 21
  • 185
  • 218

You could start with the following command-line invocation:

jq -n "[inputs | .messages] | add" *.json 

This assumeshas a number of assumptions. If your windows shell does not support wildcard expansion, see Passing multiple wildcard filenames to a command in Windows

Other assumptions are that you are using jq 1.5 or later, and of course that all the *.json files in the current directory are relevant and that *.json lists them in the desired order.

If the ordering of the JSON files is best determined by explicitly listing them, then you will probably want to create a batch file. If their ordering is determined by their contents, then you could use jq to order them for you, but the details of how to do will depend on the details about the sorting criteria.

You could start with the following command-line invocation:

jq -n "[inputs | .messages] | add" *.json 

This assumes you are using jq 1.5 and of course that all the *.json files in the current directory are relevant and that *.json lists them in the desired order.

If the ordering of the JSON files is best determined by explicitly listing them, then you will probably want to create a batch file. If their ordering is determined by their contents, then you could use jq to order them for you, but the details of how to do will depend on the details about the sorting criteria.

You could start with the following command-line invocation:

jq -n "[inputs | .messages] | add" *.json 

This has a number of assumptions. If your windows shell does not support wildcard expansion, see Passing multiple wildcard filenames to a command in Windows

Other assumptions are that you are using jq 1.5 or later, and of course that all the *.json files in the current directory are relevant and that *.json lists them in the desired order.

If the ordering of the JSON files is best determined by explicitly listing them, then you will probably want to create a batch file. If their ordering is determined by their contents, then you could use jq to order them for you, but the details of how to do will depend on the details about the sorting criteria.

Source Link
peak
  • 119.1k
  • 21
  • 185
  • 218

You could start with the following command-line invocation:

jq -n "[inputs | .messages] | add" *.json 

This assumes you are using jq 1.5 and of course that all the *.json files in the current directory are relevant and that *.json lists them in the desired order.

If the ordering of the JSON files is best determined by explicitly listing them, then you will probably want to create a batch file. If their ordering is determined by their contents, then you could use jq to order them for you, but the details of how to do will depend on the details about the sorting criteria.