compare 2 files

Reply

Join Date: Apr 2008
Posts: 1
Reputation: emile123 is an unknown quantity at this point 
Solved Threads: 0
emile123 emile123 is offline Offline
Newbie Poster

compare 2 files

 
0
  #1
Apr 13th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 148
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: compare 2 files

 
0
  #2
Apr 13th, 2008
Shell Scripting Syntax (Toggle Plain Text)
  1. # grep -f file -v file1
  2. D
  3. E
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC