I
I
ivanKut2019-04-30 16:28:07
Windows
ivanKut, 2019-04-30 16:28:07

How to subtract one file from another?

There are two txt files, in which logins are recorded each from a new line. Only 3 million lines in each.
How can one subtract the other from one?
That is, in the first file you need to leave those logins that are NOT present in the second.
Is there any Windows application to solve such problems?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
W
wisgest, 2019-04-30
@wisgest

Execute from CMD.EXE (or batch file): Findstr
utility switches used :

/B Look for pattern only at the beginning of lines.
/E Look for pattern only at the end of lines.
/V Print lines that do not match the search strings.
/G:file Get lines from the given file

B
Boris Korobkov, 2019-04-30
@BorisKorobkov

For Linux, this is done with the following command:
-v Invert the sense of the match, ie look for things not matching.
-x When matching a pattern, require that the pattern matches the whole line, ie not just anywhere on the line.
-F When matching a pattern, treat it as a fixed string, ie not as a regular expression.
-f Read patterns from the given file (forbidden_logins.txt).

D
Dimonchik, 2019-04-30
@dimonchik2013

there is a total commander

B
benipaz, 2019-04-30
@benipaz

PowerShell
is a similar example, but you need to change it for yourself https://www.mytechnote.ru/en/node/253

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question