Deleting lines based on comparing fields.....
Hi all,
I am not sure how to aproch this, or what to use ie. sed, awk, grep, all of the above....
I have many lines of text like below this in a file:
serverf2 /vol/serverv1/appl_some_application_instance_prod_sybdump019
1 Missing Files - 0 files on tape - 1 files purged
serverf2 /vol/serverv1/appl_some_application_instance_prod_sybdump019
2 Missing Files - 1 files on tape - 1 files purged
serverf2 /vol/serverv1/appl_some_application_instance_prod_sybdump019
6 Missing Files - 0 files on tape - 3 files purged
serverf2 /vol/serverv1/appl_some_application_instance_prod_sybdump019
3 Missing Files - 0 files on tape - 1 files purged
I need to compare the "missing files" with the "files on tape" and the "files purged"
In the first line, there is 1 missing file, but it has been purged so I don't care to see it.
In the last line, there are three missing files and only one was purged. I need to action this as there are 2 files unaccounted for.
There can be hundreds of lines like this and I want to find a way to strip out the unimportant one, or copy out the important ones. Is this too complicated for sed, awk etc?
Last edited by OldGaf; 02-21-2008 at 10:08 PM.
Reason: spelling..... uh!
|