Article 4W7EA Search multiple lines in a file

Search multiple lines in a file

by
cbtshare
from LinuxQuestions.org on (#4W7EA)
Hello All,

I have a file with a particular pattern that I want.(with the title ParameterValue)

Code:"ParameterName":
"ParameterValue":
"Description":
"Source": "
"ApplyType":
"DataType":
"AllowedValues":
"IsModifiable":The file also has patterns with no ParameterValue i.e

Code:"ParameterName":
"Description":
"Source": "
"ApplyType":
"DataType":
"AllowedValues":
"IsModifiable":Is there a way I can get only content that corresponding ParameterName AND ParameterValue

The values are in a file calle dbparam2

I have tried the following:

Only gets ParameterValue, but I need the name
Code:grep -- 'ParameterValue*' dbparam2gets both, but it get ParameterName ONLY values as well, they dont match
Code:grep -e ParameterName -e ParameterValue dbparam2Shows nothing
Code:awk '/ParameterName/ && /ParameterValue/' dbparam2Please assist me, thank youlatest?d=yIl2AUoC8zA latest?i=83fEHguFW0Q:XK5WY5mu2Z0:F7zBnMy latest?i=83fEHguFW0Q:XK5WY5mu2Z0:V_sGLiP latest?d=qj6IDK7rITs latest?i=83fEHguFW0Q:XK5WY5mu2Z0:gIN9vFw83fEHguFW0Q
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments