How to split the following array so that i can get lon and lat points only every time ? In perl Script ?
[{"lon":77.594376,"lat":12.971606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.604376,"lat":12.980606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.674376,"lat":12.981606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.684376,"lat":12.982606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.744376,"lat":12.983606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.784376,"lat":12.990606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.804376,"lat":12.991606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.824376,"lat":12.995606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.874376,"lat":12.997606,"bfg":18000,"xyz":null,"jky":null},{"lon":77.894376,"lat":12.999606,"bfg":18000,"xyz":null,"jky":null}]
Any help ?
You can use a JSON library in Perl to parse your JSON string. After that, you will have an array of hashes that you can iterate over and extract the lat/lon values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With