I want to compare two files to check for differences between them, fileA and fileB. fileA is like a template file and fileB is the file which I want to compare to it. Anytime I find a difference I want to output that difference to fileC.
The difficulty is that fileA and fileB contain certain (not all) lines which have some data which will always be different - time, date and a randomnly generated id code. However, I do not want to output lines to fileC where the only difference is time, date and id code.
So what I would like to do is to remove the time, date and id code from any lines where they occur in fileB (I can do this manually in fileA) and then do a comparison against fileB, outputting the different lines to fileC.
Note that the text to remove always follows specific patterns. So I can find the text using grep with those patterns, but I don't know how to remove it...
Here is an example of the two files to show what I mean:
qaqa rara abc 10:12:25 08/20/2014 123456 def ghi fff ddd jkl 09:20:40 08/20/2014 978645 dfdf gggg
qaqa rara abc 10:32:15 07/15/2014 121456 xxx ghi eee ddd jkl 10:01:22 07/15/2014 971645 dfdf gggg
I want to find the difference between the above two files, disregarding the time (e.g 10:12:25), date (e.g. 08/20/2014) or id code (e.g. 123456) and output the differences to fileC
The two lines which are different, therefore are lines 2 and 3. Line 1 is the same for both files. Line 4 is the same for both files when the time, date and id info has been removed.