DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Shell Scripting (http://www.daniweb.com/forums/forum113.html)
-   -   compare 2 files (http://www.daniweb.com/forums/thread118858.html)

emile123 Apr 13th, 2008 5:42 am
compare 2 files
 
I need some help with this:
I want to compare 2 files, and get an output file with only the new lines of File2 (compared to File1)

I didnt manage to do this with diff, any suggestions how to solve this?

Example:
File1:
A
B
C

File2:
A
B
C
D
E

Output file:
D
E

ghostdog74 Apr 13th, 2008 11:30 am
Re: compare 2 files
 
# grep -f file -v file1
D
E


All times are GMT -4. The time now is 8:37 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC