I have a file with contents like :

Apple 100

banana 200

Cat 300

I want to search for a particular string in the file and get the next word. Eg: I search for cat, I get 300. I have looked up this solution: [How to Find Next String After the Needle Using Strpos()](https://stackoverflow.com/questions/4866968/how-to-find-next-string-after-the-needle-using-strpos), but that didn't help and I didn't get the expected output. I would be glad if you can suggest any method without using regex.