I need to search a Text File for Different Strings and accordingly I need to do different actions.

Say,
- if the test file has 'Login' and 'Failed' I should Say 'Login failed'
- if the test file has 'JOB' then I should strip the next 4 character (for e.g., let
us say it is 1234) and then Say 'JOB1234 Submitted'
- if the test file has 'Login' and 'Password' I should Say 'Login Succeeded Change
Your Password
- if the test file has 'GoodBye' and 'Close' I should Say 'Connection Closed'


How do I do this? The file would be pretty large sometime.