Skip to main content
added 3 characters in body
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 266

I have a string which is concatenation of "key":"value" pairs seperatedseparated by "," like-

KEY1:VALUE1, KEY2:VALUE2, KEY3:VALUE3 

And fromFrom this string, I have to grep value for a specific string,lets -- let's say KEY2, -- so the output of our command should be VALUE2.

I have a string which is concatenation of "key":"value" pairs seperated by "," like-

KEY1:VALUE1, KEY2:VALUE2, KEY3:VALUE3 

And from this string I have to grep value for a specific string,lets say KEY2, so output of our command should be VALUE2.

I have a string which is concatenation of "key":"value" pairs separated by "," like-

KEY1:VALUE1, KEY2:VALUE2, KEY3:VALUE3 

From this string, I have to grep for a specific string -- let's say KEY2 -- so the output of our command should be VALUE2.

Became Hot Network Question
Source Link

Grep value of a specific key from a String, concatenated of key : value pairs

I have a string which is concatenation of "key":"value" pairs seperated by "," like-

KEY1:VALUE1, KEY2:VALUE2, KEY3:VALUE3 

And from this string I have to grep value for a specific string,lets say KEY2, so output of our command should be VALUE2.