Blacksmoke16 / oq

A performant, and portable jq wrapper to facilitate the consumption and output of formats other than JSON; using jq filters to transform the data.
https://blacksmoke16.github.io/oq/
MIT License
190 stars 15 forks source link

parse error: Invalid numeric literal at line 1, column 5 #34

Closed Nowaker closed 4 years ago

Nowaker commented 4 years ago
~ # cat blah.yml
lang:
- en
- es
~ # ./oq-0.2.0-linux-x86_64 -r '.' blah.yml
parse error: Invalid numeric literal at line 1, column 5

Same thing executed on a JSON equivalent of blah.yml using jq:

~ # cat blah.json
{"lang": ["en", "es"]}
~ # jq -r '.' blah.json
{
  "lang": [
    "en",
    "es"
  ]
}

Note: I use oq 0.2.0 because no Linux binaries were available.

EDIT: Thanks for providing the binary for 0.2.1. Same problem there:

~ # ./oq-0.2.1-linux-x86_64 -r '.' blah.yml
parse error: Invalid numeric literal at line 1, column 5
Blacksmoke16 commented 4 years ago

The default input format is JSON, you would want to do.

./oq-0.2.1-linux-x86_64 -i yaml -r . blah.yml

in order to set the input format as YAML, which yields:

 ./oq-0.2.1-linux-x86_64 -i yaml -r . data.yaml 
{
  "lang": [
    "en",
    "es"
  ]
}
Nowaker commented 4 years ago

Thanks! I'll modify README.md later to indicate that.