I have two text file "account.txt" and "customer.txt"
**account.txt** 876251251 716126181 888281211 666615211 787878787 111212134 **customer.txt** 876251251 716126181 792342108 792332668 666615211 760332429 791952441 676702288
I need to compare "account.txt" with "customer.txt".
- All account numbers from
account.txtshould be present in
customer.txtfile and if
customer.txtis missing any "account number" then we should print out all those account numbers which are missing in
- And also all those extra customer numbers in
customer.txtthat are not present in
account.txtfile, I want to print that as well.
Output should be:
Missing Account Number: 888281211 787878787 111212134 Extra Customer Number: 792342108 792332668 760332429 791952441 676702288
Is this possible to do in linux? I started off like this but it only does the first case I want, not the second one? Also I need to print the output in the above format.
comm -23 account.txt customer.txt
Note: It could be possible that there are some strings or empty lines in those files so we need to discard that in the comparison if we see any. We only need to compare valid numbers.