How do I get the all values from a "key"="value" in a file.
Example: I have a text file as below:
"This is the file which contains,"key"="value",so extract value. This is the file which contains another value,"key"="value1",so extract value."
How do I get the all values from a "key"="value" in a file.
Example: I have a text file as below:
"This is the file which contains,"key"="value",so extract value. This is the file which contains another value,"key"="value1",so extract value."
Maybe this help?
grep -oP '(?<=\"key\"=\")(.*?)(?=\")' file anotherfile
If you don't want filenames in output use -h