Solved Comparing 2 texfiles and displaying the difff in third file

May 28, 2012 at 05:59:26
Specs: Windows XP
Hi,

I have two text files say text1.txt and text two.txt..I want to compare contents of text1 with text2..If the text1 contents are not in text2 i want to display that in third log file say text3.text..

here is my code please help me execute it as per my requirements...

@echo on

title Comparing two log files...

call C:\MM_TransExp\site_specific\site_env.cmd
echo on

cd\
cd C:\MM_TransExp\log
rem pause
dir /b C:\MM_TransExp\log\*.txt

for /f "tokens=* delims=" %%A in (Released.txt) do set item=%%A&

for /f "tokens=* delims=" %%a in (Pdfconverted.txt) do set itemid=%%a&

for /F "tokens=* delims=" %%A in (Released.txt) do (
call :myInnerLoop "%%A"
)

goto :eof


:myInnerLoop
for /F "tokens=* delims=" %%a in (Pdfconverted.txt) do (
if %%A==%%a (

goto :next
)
echo %%A > C:\MM_TransExp\log\Failed.txt
)
:next

goto :eof


See More: Comparing 2 texfiles and displaying the difff in third file

Report •


#1
May 28, 2012 at 09:07:48
✔ Best Answer
:: ===== script starts here ===============
::
:: irfan.bat Mon 28-05-2012 22:49:42.27
@echo off > newfile & setLocal enableDELAYedeXpansioN

for /f "tokens=* delims= " %%a in (one) do (
find "%%a" < two > nul
if errorlevel 1 >> newfile echo.%%a
)
::====== script ends here =================


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
May 30, 2012 at 22:34:53
Works Great !!!

Thanks a lot....


Report •

#3
May 30, 2012 at 22:39:05
Please help me to rename all the ".txt" files in folder "C:\MM_TransExp\Pdf_backup" with the current date suffixed to the file name....

Appreciate your help on this..

Thanks in advance


Report •

Related Solutions

#4
May 31, 2012 at 00:59:05
pls,start a new thread.


=====================================
Life is too important to be taken seriously.

M2


Report •


Ask Question