File verification

MCarlos

New Member
Joined
Nov 9, 2018
Messages
2
Reaction score
1
Credits
0
Hi guys,

I have 2 Files filled with numbers on each line: f1.txt and f2.txt

I just want to keep in f1.txt numbers that are not in f2.txt.

If Number1 in f1.txt is not in f2.txt then keep it
else remove it from f1.txt
 


CptCharis

Well-Known Member
Joined
Feb 27, 2018
Messages
563
Reaction score
465
Credits
982
Hello @MCarlos

You can use diff command, something like
Code:
diff f1.txt f2.txt


or some alternatives like colordiff if you want colour result output or wdiff if you want word by word comparison.
another command is cmp

Code:
cmp f1.txt f2.txt

You can find many tutos in web.
 
OP
M

MCarlos

New Member
Joined
Nov 9, 2018
Messages
2
Reaction score
1
Credits
0
Thanks for your reply.
The problem is also to remove Numbers from File1 that are present in File2.
It's not only comparing.
 

Members online


Top