Skip to content

Quotes in output if string is number #91

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

You must be logged in to vote

Hey @paradajz - This isn't a bug.

Since you are referencing a YAML file the input + output is being parsed/formatted as YAML.

  • "native" is a string
  • native is a string
  • "4067" is a string
  • 4067 is an int

In order for dasel to output 4067 as a string it must be surrounded by quotes.

If you do not want the output to be formatted as yaml you can use the -w - flag or --plain flag.

These are equivalent for this use-case and will cause the output to be native and 4067 without quotes.

$ dasel -n -f demo.yml --plain analog.type
4067

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TomWright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #90 on February 11, 2021 16:49.