Answer the question
In order to leave comments, you need to log in
How to compare the difference in two text documents and output the difference to a new text document?
I do operations with pictures, jpg , I monitor the folder where the pictures are, add the paths and names of all files to log.txt and then I calmly process it,
but the folder with pictures often involuntarily litters and the old pictures remain by necessity,
the question is: how to add to log.txt only those pictures that weren't there before?
As I see it:
we make 2 log files, log.txt and newlog.txt
log.txt - everything that was written earlier
in newlog.txt is added everything that is in the folder at the moment, then it is compared with log.txt , all the difference is written down in result.txt
is this possible? How to do it tell me?
ps here is the contents of log.txt
Answer the question
In order to leave comments, you need to log in
Just check if the current file is in the log, if not, add it.
Something like this:
for %%a in (c:\test\*.jpg) do (
findstr /c:"%%~fa" log.txt || echo.%%~fa>log.txt
)
windiff (MS):
Usage:
windiff [options] path1 [path2]
Options:
-D Compare one directory only.
-F[flags] savefile Save composite file to 'savefile'.
The 'flags' may consist of one or more of I (identical), L (left), R (right), F (moved leFt),
G (moved riGht), S (Similar left), A (similiAr right), X (exit after saving list).
(e.g. -FLF saves list of Left or moved-leFt lines).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question