I'm running OSX. What command line tool could I use for this? I've got a large text file with this JSON output. I'm looking for a way to strip out only those email
s without a last_login_date
, where I'm not interested in the record without one. Here's the output:
{
"_id" : ObjectId("52fba903e4b0aa6226e0ce26"),
"email" : "bar@foo.com"
}
{
"_id" : ObjectId("521ca254e4b0d28eb6a07f26"),
"email" : "foo@bar.com",
"last_login_date" : ISODate("2017-04-10T14:27:03.212Z")
}
Is sed or awk a candidate for this? If so, can you show me how strip out from the file:
{
"_id" : ObjectId("52fba903e4b0aa6226e0ce26"),
"email" : "bar@foo.com"
}