Last active
April 19, 2018 08:36
-
-
Save arc279/25c43b2f6b23f112a367f8c3578e433b to your computer and use it in GitHub Desktop.
json配列を1行ずつに分割・それを戻す
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cat <<EOD | jq -c '.[]' | |
| > [ [ 11, 12, 13 ], [ 21, 22, 23 ], [ 31, 32, 33 ] ] | |
| > EOD | |
| [11,12,13] | |
| [21,22,23] | |
| [31,32,33] | |
| $ | |
| $ cat <<EOD | jq -c '.[]' | jq -s 'reduce .[] as $i ([]; .+[$i])' | |
| > [ [ 11, 12, 13 ], [ 21, 22, 23 ], [ 31, 32, 33 ] ] | |
| > EOD | |
| [ | |
| [ | |
| 11, | |
| 12, | |
| 13 | |
| ], | |
| [ | |
| 21, | |
| 22, | |
| 23 | |
| ], | |
| [ | |
| 31, | |
| 32, | |
| 33 | |
| ] | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment