Skip to content

Problem handling underscores in field names? #3

Closed
@stevec64

Description

@stevec64

I tried this:

$ jq '.data[1].target_platform' < mata.txt 

error: Invalid character
.data[1].target_platform
               ^
error: syntax error, unexpected IDENT, expecting $end
.data[1].target_platform
                ^^^^^^^^
2 compile errors

The input is a vanilla JSON file with entries like:

{
    "target_country_code": [ "US" ],
    "day": "2012-09-21",
    "campaign_name": "Best Game Ever campaign-11",
    "spend": 663,
    "bundle_id": "com.foo.best_game",
    "target_manufacturer": [ "Samsung" ],
    "clicks": 12,
    "downloads": 6,
    "campaign_id": 11,
    "app_id": "12341",
    "currency": "USD",
    "impressions": 30,
    "target_platform": [ "Nexus S", "阿里云" ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions