Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: parse json data with underscore symbol

by amaa11 (Initiate)
on Aug 19, 2018 at 10:05 UTC ( [id://1220608]=note: print w/replies, xml ) Need Help??


in reply to Re^4: parse json data with underscore symbol
in thread parse json data with underscore symbol

Dear Kevbot, Thanks a lot for providing me these info.
Just imagine that I have a very long of the data (Json) as i posted in the post. And I wand print all what I want by a loop to parse all the data.
Can you suggest any module or way to do that??
Regards

  • Comment on Re^5: parse json data with underscore symbol

Replies are listed 'Best First'.
Re^6: parse json data with underscore symbol
by kevbot (Vicar) on Aug 20, 2018 at 04:41 UTC
    Hello amaa11,

    It's difficult to give advice because the code you need to write will be highly dependent on the data structure returned by decode_json, which is highly dependent on the structure of your JSON string.

    If you are going to be extracting data from complex JSON strings, then it may be helpful to use a module that helps you extract the data (without having to worry about the perl data structure). One such module is JSON::Path. It lets your write a JSONPath string to extract the data. This way you can write a JSONPath string that will extract only the portion of data that you are interested in and it will reduce the amount of perl code you need to write. I have converted your script of use JSON::Path to give you an example to work from.

    If you choose to use this module, I recommend you carefully read the documentation for the JSON::Path and JSONPath - XPath for JSON.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1220608]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found