Skip to content

Rename\transform a key\selector #240

Answered by TomWright
electriquo asked this question in Q&A
Discussion options

You must be logged in to vote

There isn't a specific rename feature but you could do something like this:

$ echo '{"foo":"spam"}' > file.json
dasel put string -f file.json '.bar' $(dasel -f file.json --plain '.foo')
dasel delete -f file.json '.foo'
~ [] $ cat file.json
{
  "bar": "spam"
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by electriquo
Comment options

You must be logged in to vote
2 replies
@TomWright
Comment options

@TomWright
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants