comp algorithm
first file comp group
second file comp group
third omp group
:
:
one thousand
:
:
:
comparison time 1300file = 10 hour
1year...late today..
1300 file comp..
comparison time = some 5min...
a fake my source..open..
Notice:
sourcef & targerf name equally make..
one folder group comp..
two folder comp not open to the public <--- many bug T_T;;a
@echo off
set timex=%time%
setlocal EnableDelayedExpansion
set sourcef=\1\
set targetf=\1\
set extfile=*.*
set mainfolder=%cd%
cd %mainfolder%\
if exist ".%targetf%tempx.txt" del ".%targetf%tempx.txt"
if exist ".%sourcef%files1.txt" del ".%sourcef%files1.txt"
if exist ".%targetf%files2.txt" del ".%targetf%files2.txt"
call :dir1
:loof
call :files1
echo Target : %files1%
call :files2
call :swap1
if not exist ".%targetf%files2.txt" goto :end
goto :loof
goto :end
:swap1
cd %mainfolder%\
cd .%targetf%
if exist "files2.txt" (
del "files2.txt"
copy "tempx.txt" "files1.txt">nul
ren "tempx.txt" "files2.txt"
)
cd %mainfolder%\
goto :eof
:dril
for /f "delims=" %%y in (%~1) do (
if "%%y" neq "%~1" (
if "%%y" neq "%~2" (
echo %%y>>tempx3.txt
)
)
)
del %1
ren "tempx3.txt" %1
goto :eof
:dir1
cd %mainfolder%\
cd .%sourcef%
dir %exfile% /a-d /o-sn /-c /b >files1.txt
call :dril "files1.txt" "files2.txt"
cd %mainfolder%\
cd .%targetf%
dir %exfile% /a-d /o-sn /-c /b >files2.txt
call :dril "files2.txt" "files1.txt"
cd %mainfolder%\
goto :eof
:files1
cd %mainfolder%\
cd .%sourcef%
for /f "delims=" %%j in (files1.txt) do (
set files1=%%j
set filess1=%%~zj
goto :forx
)
:forx
cd %mainfolder%\
goto :eof
:files2
cd %mainfolder%\
cd .%targetf%
for /f "skip=1 delims=" %%f in (files2.txt) do (
set files2=%%f
set filess2=%%~zf
cd %mainfolder%\
if %filess1% equ !filess2! (
echo n|comp ".%sourcef%%files1%" ".%targetf%!files2!" >nul
if !errorlevel! equ 0 (
echo True.----------------
if not exist ".\temp2\%files1%\" md ".\temp2\%files1%\"
move /y ".%targetf%!files2!" ".\temp2\%files1%\!files2!"
) else (
echo false.---------------
echo !files2!>>.%targetf%tempx.txt
)
) else (
echo !files2!>>.%targetf%tempx.txt
)
cd .%targetf%
)
goto :eof
:end
cd %mainfolder%\
if exist ".%sourcef%files1.txt" del ".%sourcef%files1.txt"
if exist ".%targetf%files2.txt" del ".%targetf%files2.txt"
echo start--%timex% end-- %time%
:endlocal
pause