-1

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."

sidyll
  • 57,726
  • 14
  • 108
  • 151
KishoreKumar
  • 143
  • 1
  • 3
  • 11

1 Answers1

0

Maybe this help?

grep -oP '(?<=\"key\"=\")(.*?)(?=\")' file anotherfile

If you don't want filenames in output use -h

lojza
  • 1,823
  • 2
  • 13
  • 23