Is there any tool that can get lines which file A contains, but file B doesn't? I could make a little simple script with, e.g, perl, but if something like that already exists, I'll save my time from now on.
|
|
Yes. The standard
This works by using each line in fileB as a pattern ( The downside of this solution is that it doesn't take line order into account and if your input has duplicate lines in different places you might not get what you expect. The solution to that is to use a real comparison tool such as
|
||||
|
|
|
If the files are big and you don't have a custom order to your entries, grep takes much too long. A quick alternative would be
[file2-file1 results to screen, pipe to file etc.] Changing |
||||
|
|
|
You could also consider vimdiff, it highlights the differences between files in a vim editor |
|||
|
|
|
The answer depends a great deal on the type and format of the files you are comparing. If the files you are comparing are sorted text files, then the GNU tool written by Richard Stallman and Davide McKenzie called |
||||
