Skip to content

Commit

Permalink
Add note and example for jq
Browse files Browse the repository at this point in the history
  • Loading branch information
xylo04 committed Jan 14, 2021
1 parent b274c32 commit ce53bfc
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,34 @@ document was imported into a
for formatting and cleansing. I added country codes, unicode flag glyphs and callsign prefix regular
expressions (regexes), and exported the spreadsheet as the CSV contained in this repository.
Finally, the included python script generates the JSON file.

One simple way to generate a smaller file with just what you need is to use the `jq` utility.

```commandline
$ < dxcc.json jq -c '{dxcc: [ .dxcc[] | select( .deleted==false ) |
{id: .entityCode, name: .name, prefixRegex: .prefixRegex, flag: .flag} ]}' > dxcc-filter.json
{
"dxcc": [
{
"id": 1,
"name": "Canada",
"prefixRegex": "^V[A-GOY][A-Z0-9/]*$",
"flag": "🇨🇦"
},
{
"id": 3,
"name": "Afghanistan",
"prefixRegex": "^(YA|T6)[A-Z0-9/]*$",
"flag": "🇦🇫"
},
...
{
"id": 522,
"name": "Kosovo",
"prefixRegex": "^Z6[A-Z0-9/]*$",
"flag": "🇽🇰"
}
]
}
```

0 comments on commit ce53bfc

Please sign in to comment.