.cr2 and .jpg : synching image files with different extensions

Discuss new features and functions
Posts: 1
Joined: 27 Nov 2003

weberjn

Hi,

in my photography workflow I have camera raw files *.cr2 that are converted into *.jpg files in another folder, e.g. raw/IMG_4279.cr2 -> jpeg/IMG_4279.jpg
I walk through the jpg folder and delete the bad ones (this is faster than with the originals). Then, all *.jpg files missing from the jpeg folder should be also deleted in the raw folder *.cr2

An equivalent problem would be:

Folder A contains *.txt, folder B contains *.txt.bak
Now delete all .bak in B that do not have an original in A

Can this be done with FreeFileSync?

Thx,
Juergen
Posts: 22
Joined: 18 Dec 2009

grobbla

Servus,

this may be a bit late, but what about a batch file?
Here is an example that does what you want. If there are spaces in the path/file name, you will need to use apostrophes in the batch. The example does not actually delete, it just echoes.


Save as example.cmd
..................................................
@echo off
set B=test
set A=.

for /f %%i in ('dir /b %B%\*.bak') do call :chk %%i
goto :end

:chk
echo check: %B%\%1 -- %A%\%~n1
if not exist %A%\%~n1 (
echo delete %B%\%1
) else (
echo preserve %B%\%1
)
echo.
goto :eof

:end
..................................................