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

members_list.json をまともな JSON らしくする #238

Open
takano32 opened this issue May 8, 2020 · 1 comment
Open

members_list.json をまともな JSON らしくする #238

takano32 opened this issue May 8, 2020 · 1 comment

Comments

@takano32
Copy link
Member

takano32 commented May 8, 2020

members_list.json がすごく JSON っぽくない。

$ cat tmp/members_list.json
"U0122V68Q5A" "U01296D29H6" "U011S5JHAJX"

jq -r . で回してもいいような気がするけれどきちんと分かりやすい配列にしたい気がする。

メモ

$ echo '{"channel": {"members":["A","B","C"]} }'| jq .
{
  "channel": {
    "members": [
      "A",
      "B",
      "C"
    ]
  }
}

配列にする

$ echo '{"channel": {"members":["A","B","C"]} }'| jq '[.channel.members[] | .]'
[
  "A",
  "B",
  "C"
]
@takano32
Copy link
Member Author

takano32 commented May 8, 2020

members_list.json を使っているところも見て回らないといかんのでわりとめんくさい。

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