-2

My text file contains data in the below format

{ "_id" : "abc" }
{ "_id" : "def" }
{ "_id" : "ghi" }
{ "_id" : "jkl" }

How can I extract the values from the above input and print it as below using shell commands

abc
def
ghi
jkl
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
Abhiram Varma
  • 105
  • 2
  • 9

1 Answers1

0

With a proper parser:

jq '._id' file.json
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223