Script to delete duplicate files with same names but different extensions -


i using audacity's chains scripting function batch-convert , edit many large, uncompressed .wav files @ once smaller .ogg format. end folder structure following:

f:/sound-recordings: -- rec1.wav -- rec2.wav -- rec3.wav -- rec4.wav -- rec5.wav f:/sound-recordings/cleaned: -- rec1.ogg -- rec2.ogg -- rec3.ogg 

some of source .wav files corrupted (note rec4.wav , rec5.wav in above example), , audacity not convert them (at least through chains function). creates problem, can become tedious compare 2 folders, , delete .wav files converted .ogg.

in example above, "rec1.wav", "rec2.wav", , "rec3.wav" should deleted, while "rec4.wav" , "rec5.wav" untouched, since weren't converted.

i need script (batch or python preferred) delete .wav files main folder, have identically named .ogg files located in "cleaned" folder, leaving other .wav files untouched.

@echo off  %%i in (f:\sound-recordings\*.wav) (     if exist f:\sound-recordings\cleaned\%%~ni.ogg del %%i ) 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -