-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 Quenot
  • 154,891
  • 35
  • 213
  • 206
Abhiram Varma
  • 105
  • 1
  • 9

1 Answers1

0

With a proper parser:

jq '._id' file.json
Gilles Quenot
  • 154,891
  • 35
  • 213
  • 206