Deleting lines based on comparing fields.....
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:
1 Missing Files - 0 files on tape - 1 files purged
2 Missing Files - 1 files on tape - 1 files purged
6 Missing Files - 0 files on tape - 3 files purged
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 11:08 PM.
Reason: spelling..... uh!