I have added the creation of a sub-directory called RAW and the deletion of all the original JPG's from the camera (as I don't use them anymore).
And I've creared a 2nd script which can be run after the "developing part" of the workflow. This 2nd script checks which RAW-files have been processed succesfully and moves those RAW-files and their configuration-file (made by DXO Optics) to the RAW sub-directory. I keep them archived in case I want to process them in the future again.
In the main directory it leaves:
- DSC01868_DxO.JPG
- DSC01869_DxO.JPG
- DSC01870_DxO.JPG
While in the RAW-subdirectory one gets:
- DSC01868.ARW
- DSC01868.ARW.dop
- DSC01869.ARW
- DSC01869.ARW.dop
- DSC01870.ARW
- DSC01870.ARW.dop
First script (Windows batch), which deletes the unwanted RAW's, creates a RAW-directory and deletes all original JPG's:
@echo off
for %%F in (*.arw) do (
if exist %%~nF.jpg (
echo File %%F is kept
echo ------------------------
) else (
del %%F
echo File %%F is removed
echo ------------------------
) )
del *.jpg
mkdir RAW
goto :EOF
The 2nd script (Windows batch), which moves the RAW-files and their configuration files to the RAW-subdirectory:
@echo off
for %%F in (*.arw) do (
if exist %%~nF_DxO.jpg (
move %%F RAW\
move %%F.dop RAW\
echo %%F en %%F.dop are moved
echo ------------------------
) else (
echo Nothing moved
echo ------------------------
) )
goto :EOF
I haven made the Bash (Linux) equivalents of these scripts as well.
The first script:
#!/bin/bash
for rawfile in *.ARW
do
jpegfile="`basename "$rawfile" .ARW`.JPG"
if [ ! -e $jpegfile ]
then
/bin/rm -f $rawfile
fi
done
mkdir RAW
rm *.JPG
The 2nd script:
#!/bin/bash
for rawfile in *.ARW
do
jpegfile="`basename "$rawfile" .ARW`_DxO.jpg"
dopfile="$rawfile.dop"
echo "$jpegfile"
if [ -e $jpegfile ]
then
mv $rawfile ./RAW/$rawfile
mv $dopfile ./RAW/$dopfile
fi
done