find an entry in a file and do something