To be honest... I wasn't aware of it bit some image editor tool created bak files when updating images.
A search on ext:bak.jpg shows I have over 3000 .bak.jpg files on backup drives etc.
So I have
File name.bak.jpg 1.216.512 bytes
File name.jpg 1.216.512 bytes
I do not want to just CTRL-A Delete all the .bak files as maybe there is non-bak file of the same size.
How to delete only those .bak.jpg files when there is a 'non-bak' file with the same size.
Give up on trying with regex: I do not have the required expertise, so to say.
Anyone ??
Thanks!
Delete file name.bak.jpg when file name.jpg with same size exists
Re: Delete file name.bak.jpg when file name.jpg with same size exists
I would use this
Column A will show the name but remove ".bak" for any files that have that. So you can look for dupes based on Column A and size.
Column B will only show ".bak.jpg" for the files that have ".bak.jpg". For "filename.jpg", it will be blank. So now you can sort by Column B, select all of the ones that have a ".bak.jpg" value for Column B and delete them.
Code: Select all
add-column:a a:=regexreplace(name:,".bak.jpg",".jpg") add-column:b b:=regexextract(name:,".bak.jpg") dupe:columna,sizeColumn B will only show ".bak.jpg" for the files that have ".bak.jpg". For "filename.jpg", it will be blank. So now you can sort by Column B, select all of the ones that have a ".bak.jpg" value for Column B and delete them.
Re: Delete file name.bak.jpg when file name.jpg with same size exists
Thanks for taking the time to search for a solution. For good order's sake: one need to add filter on images (else other extensions are also displayed, like .mum, .cat, etc.)
I wonder whether it is possible to add size under 'a:' and 'b:' so I can see that sizes are identical.
Only those .bak.jpg files that have the same size as .jpg (non bak) with the same file name, those can be deleted.
There may also be .bak.jpg files with a different size. Those I need to check separately.
Note sure if it is possible though...
thanks again.
I wonder whether it is possible to add size under 'a:' and 'b:' so I can see that sizes are identical.
Only those .bak.jpg files that have the same size as .jpg (non bak) with the same file name, those can be deleted.
There may also be .bak.jpg files with a different size. Those I need to check separately.
Note sure if it is possible though...
thanks again.
Re: Delete file name.bak.jpg when file name.jpg with same size exists
Maybe like this?eswul62 wrote: Fri Mar 14, 2025 11:14 am I wonder whether it is possible to add size under 'a:' and 'b:' so I can see that sizes are identical.
Re: Delete file name.bak.jpg when file name.jpg with same size exists
You can add other filters in front of this. For example, addeswul62 wrote: Fri Mar 14, 2025 11:14 am Thanks for taking the time to search for a solution. For good order's sake: one need to add filter on images (else other extensions are also displayed, like .mum, .cat, etc.)
Code: Select all
ext:jpgRight click the header bar and add any other columns you want to seeI wonder whether it is possible to add size under 'a:' and 'b:' so I can see that sizes are identical.
Only those .bak.jpg files that have the same size as .jpg (non bak) with the same file name, those can be deleted.
Code: Select all
dupe:columna,size