I am using a local JSON file to get a country name from a country code.
I don't want to read the entire file to a string, just the part that matches to the country code given.
This is the JSON file pattern:
{
"name": {
"common": "Austria",
"official": "Republic of Austria",
"native": {
"bar": {
"official": "Republik Österreich",
"common": "Österreich"
}
}
},
"tld": [".at"],
"cca2": "AT",
"ccn3": "040",
"cca3": "AUT",
"cioc": "AUT",
"currency": ["EUR"],
"callingCode": ["43"],
"capital": "Vienna",
"altSpellings": ["AT", "Osterreich", "Oesterreich"],
"region": "Europe",
"subregion": "Western Europe",
"languages": {
"bar": "Austro-Bavarian German"
},
"translations": {
"cym": {"official": "Republic of Austria", "common": "Awstria"},
"deu": {"official": "Republik Österreich", "common": "Österreich"},
"fra": {"official": "République d'Autriche", "common": "Autriche"},
"hrv": {"official": "Republika Austrija", "common": "Austrija"},
"ita": {"official": "Repubblica d'Austria", "common": "Austria"},
"jpn": {"official": "オーストリア共和国", "common": "オーストリア"},
"nld": {"official": "Republiek Oostenrijk", "common": "Oostenrijk"},
"por": {"official": "República da Áustria", "common": "Áustria"},
"rus": {"official": "Австрийская Республика", "common": "Австрия"},
"spa": {"official": "República de Austria", "common": "Austria"}
},
"latlng": [47.33333333, 13.33333333],
"demonym": "Austrian",
"landlocked": true,
"borders": ["CZE", "DEU", "HUN", "ITA", "LIE", "SVK", "SVN", "CHE"],
"area": 83871
}
Any suggestions on how to read only that important bit to a string?