I have a log file which somewhat looks like this
Connected to feeder version 2.1 09:28:30 29/03/2014 Loading Account 01234567EUR
09:28:30 29/03/2014 Loading Account 0123456755JPY
09:28:30 29/03/2014 Loading Account 0123426567INR
09:28:30 29/03/2014 Loading Account 012345698887USD
09:28:30 29/03/2014 Loading Account 012343422567EUR
09:28:30 29/03/2014 Account 0234456783388KRY not set up
09:28:30 29/03/2014 Account 0234454467888CNH not set up
09:28:30 29/03/2014 Error : Closing Balance of Account 02344567888GBP Doesn't match
I want to extract the account numbers where there is a closing balance mismatch or if the account is not set-up and put those accounts into a new file for my further processing.The first step is i have used grep -il 'not set up' but after that how do I extract the account numbers, The pattern seems to be very random(not sure if I can use awk based on delimeter) Only pattern that is for sure is last 3 characters of an account Number is currency. So is it possible to use egrep and regex for this. Thanks