Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

awk function

$
0
0
Hi all,

I need to have informations in a URL :
Code:

https://www.autolib.eu/stations/
Valors I need are in bold:
Code:

{"charging_status": "nonexistent", "rental_status": "future", "subscription_status": "nonexistent", "station_id": 791, "address": "10 rue de Rome, 93110 Rosny-sous-Bois", "lat": 48.876159000000001, "lng": 2.4749207000000002, "plug": 0, "kind": "S", "name": "Rosny-sous-Bois/Rome/10", "parks": 0, "future": true, "cars": 0}
Separators are { and }

When you curl the URL it's look like :
Code:

{"charging_status": "future", "rental_status": "future", "subscription_status": "nonexistent", "station_id": 790, "address": "2 rue P\u00e9trarque, 75016 Paris", "lat": 48.861292300000002, "lng": 2.28423, "plug": 0, "kind": "S", "name": "Paris/P\u00e9trarque/2", "parks": 0, "future": true, "cars": 0}, {"charging_status": "nonexistent", "rental_status": "future", "subscription_status": "nonexistent", "station_id": 791, "address": "10 rue de Rome, 93110 Rosny-sous-Bois", "lat": 48.876159000000001, "lng": 2.4749207000000002, "plug": 0, "kind": "S", "name": "Rosny-sous-Bois/Rome/10", "parks": 0, "future": true, "cars": 0}, {"charging_status": "nonexistent", "rental_status": "future", "subscription_status": "nonexistent", "station_id": 792, "address": "1 rue Boulard, 75014 Paris", "lat": 48.834854900000003, "lng": 2.3297831000000002, "plug": 0, "kind": "S", "name": "Paris/Boulard/1", "parks": 0, "future": true, "cars": 0}
I need something like this with awk function:
Code:

curl --silent https://www.autolib.eu/stations/  | egrep -in "10 rue de Rome, 93110" |
Whith this code it give me all the page exactly like if I juste curl the page

Thank you for your help

Viewing all articles
Browse latest Browse all 16232

Trending Articles