My file is in JSON format is looks like this:
name: Tom species: mouse name: Stu species: cat name: Carter species: Dog
I have a file that is one long string, and I would like to extract only the names from this list. So the desired output is something like this:
Tom Stu Carter
I've had a lot of failed attempts at sed, for example
cat alphabet | sed 's/^.*name: \(.*\) species*/\1/g'
Tom species: mouse name: Stu species: cat name: Carter : Dog
I have a lot of really big files I'd like to do this with so if there is an efficient way to go about this that would be great