LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   getting the pattern of the value to print (https://www.linuxquestions.org/questions/linux-newbie-8/getting-the-pattern-of-the-value-to-print-4175530409/)

snehasishmohanta 01-08-2015 02:36 AM

getting the pattern of the value to print
 
what can be the pattern to get the value of "q"
below is my JSON file:-
Code:

{"requestDate":"2014-12-17 00:00:13.120","taskId":"558b7f40-014a-1000-803d-970e8333b0c9","appData":{"user_ip":"170.61.236.1, 10.0.255.47","_request_params":{"params":{"uid":["59a07452-8517-4713-c9b3-82bfd408c9f1"],"filtered":["false","false"],"requestId":["55897963-014a-1000-8021-970e8333b0c9"],"sort_by":["price "],"bId":["control"],"userid":["003f9510-2cc3-4925-efaa-3b0779082c77"],"sku":["4532886"],"q":["<U+200B><U+200B>
<U+200B>baby carrier"],"eId":["control"],"action":["click"],"sort_order":["asc"],"z":["1"]},"headers":{"x-bluecoat-via":"87ca26b138e17f23","accept-language":"en-US,en;q\u003d0.8","host":"api.apac-sg.zettata.com","x-forwarded-for":"170.61.236.1, 10.0.255.47","x-forwarded-port":"80","user-agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36","x-forwarded-proto":"http","cache-control":"max-stale\u003d0","x-real-ip":"10.0.255.47","referer":"http://www.shopclues.com/mum-mee-baby-sling-carrier-1.html","accept-encoding":"gzip, deflate, sdch"},"inCookies":[],"post":false},"cookies":[],"request_params":{"params":{"uid":["59a07452-8517-4713-c9b3-82bfd408c9f1"],"filtered":["false","false"],"requestId":["55897963-014a-1000-8021-970e8333b0c9"],"sort_by":["price "],"bId":["control"],"userid":["003f9510-2cc3-4925-efaa-3b0779082c77"],"sku":["4532886"],"q":["<U+200B><U+200B><U+200B>baby carrier"],"eId":["control"],"action":["click"],"sort_order":["asc"],"z":["1"]},"headers":{"x-bluecoat-via":"87ca26b138e17f23","accept-language":"en-US,en;q\u003d0.8","host":"api.apac-sg.zettata.com","x-forwarded-for":"170.61.236.1, 10.0.255.47","x-forwarded-port":"80","user-agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36","x-forwarded-proto":"http","cache-control":"max-stale\u003d0","x-real-ip":"10.0.255.47","referer":"http://www.shopclues.com/mum-mee-baby-sling-carrier-1.html","accept-encoding":"gzip, deflate, sdch"},"inCookies":[],"post":false},"user_agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"},"cookies":[],"status":200}

from this i want to get the value of q like this:-
Quote:

<U+200B><U+200B><U+200B>baby carrier

TB0ne 01-08-2015 07:36 PM

Quote:

Originally Posted by snehasishmohanta (Post 5297496)
what can be the pattern to get the value of "q"
below is my JSON file:-
Code:

{"requestDate":"2014-12-17 00:00:13.120","taskId":"558b7f40-014a-1000-803d-970e8333b0c9","appData":{"user_ip":"170.61.236.1, 10.0.255.47","_request_params":{"params":{"uid":["59a07452-8517-4713-c9b3-82bfd408c9f1"],"filtered":["false","false"],"requestId":["55897963-014a-1000-8021-970e8333b0c9"],"sort_by":["price "],"bId":["control"],"userid":["003f9510-2cc3-4925-efaa-3b0779082c77"],"sku":["4532886"],"q":["<U+200B><U+200B>
<U+200B>baby carrier"],"eId":["control"],"action":["click"],"sort_order":["asc"],"z":["1"]},"headers":{"x-bluecoat-via":"87ca26b138e17f23","accept-language":"en-US,en;q\u003d0.8","host":"api.apac-sg.zettata.com","x-forwarded-for":"170.61.236.1, 10.0.255.47","x-forwarded-port":"80","user-agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36","x-forwarded-proto":"http","cache-control":"max-stale\u003d0","x-real-ip":"10.0.255.47","referer":"http://www.shopclues.com/mum-mee-baby-sling-carrier-1.html","accept-encoding":"gzip, deflate, sdch"},"inCookies":[],"post":false},"cookies":[],"request_params":{"params":{"uid":["59a07452-8517-4713-c9b3-82bfd408c9f1"],"filtered":["false","false"],"requestId":["55897963-014a-1000-8021-970e8333b0c9"],"sort_by":["price "],"bId":["control"],"userid":["003f9510-2cc3-4925-efaa-3b0779082c77"],"sku":["4532886"],"q":["<U+200B><U+200B><U+200B>baby carrier"],"eId":["control"],"action":["click"],"sort_order":["asc"],"z":["1"]},"headers":{"x-bluecoat-via":"87ca26b138e17f23","accept-language":"en-US,en;q\u003d0.8","host":"api.apac-sg.zettata.com","x-forwarded-for":"170.61.236.1, 10.0.255.47","x-forwarded-port":"80","user-agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36","x-forwarded-proto":"http","cache-control":"max-stale\u003d0","x-real-ip":"10.0.255.47","referer":"http://www.shopclues.com/mum-mee-baby-sling-carrier-1.html","accept-encoding":"gzip, deflate, sdch"},"inCookies":[],"post":false},"user_agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"},"cookies":[],"status":200}

from this i want to get the value of q like this:-

Please see the "Question Guidelines" link in my posting signature. We will be happy to HELP you, but we aren't going to write things FOR YOU. Also, you have to provide details, like what programming language you're using, version/distro of Linux, what your goals actually are, etc.

Post what you have written/tried of your own, and where you're stuck, and we may be able to help. There are many, MANY ways to grab that pattern, depending on the language.


All times are GMT -5. The time now is 10:24 PM.