Need a script to find file extensions with conditions
Posted: 08 Feb 2012 00:50
Help: Need a script to find file extensions with conditions
I haven't been able to find a program to do this as not quite a "find duplicate file" scenario. Can anyone help?
Scenario:
I need to convert drawings from .pdf to .tiff/tif to be able to import into another program.
However, I often also receive the drawing as a .tiff so don't always have a corresponding .pdf.
Otherwise it would be a simple solution of deleting all .tiff.
I have about 3500 project folders, with a squillion subfolders, and backups are getting too large. If I could filter out the duplicate .tiff, that would significantly reduce the total space required.
Hence, I want to be able to search for and then move all .tiff/tif files to the local recycle bin (ie delete), where there is a matching .pdf in that subfolder location. (reduce size of backups)
So ideally the location/file path will be part of the file name for finding duplicates, as the file name may not necessarily be unique, and then examine the file extension to find "duplicates".
Example files:
1 d:\projects\House1\floorplan.pdf
2 d:\projects\House1\floorplan.tif
3 d:\projects\House2\floorplan.pdf
4 d:\projects\House2\floorplan.tif
5 d:\projects\House2\revised plan\floorplan.tif
6 d:\projects\House3\floorplan.pdf
7 d:\projects\House3\floorplan.tif
Result:
I would only want to find (and then delete) files 2,4&7
I don't want to delete file 5 as there is no matching .pdf in that subfolder...
A bonus would be to include a variable to search only files older than say 3months....
I have no scripting ability, so if someone is able to help, it would need to be the full monty.
Can anyone assist?
Thanks in advance.
I haven't been able to find a program to do this as not quite a "find duplicate file" scenario. Can anyone help?
Scenario:
I need to convert drawings from .pdf to .tiff/tif to be able to import into another program.
However, I often also receive the drawing as a .tiff so don't always have a corresponding .pdf.
Otherwise it would be a simple solution of deleting all .tiff.
I have about 3500 project folders, with a squillion subfolders, and backups are getting too large. If I could filter out the duplicate .tiff, that would significantly reduce the total space required.
Hence, I want to be able to search for and then move all .tiff/tif files to the local recycle bin (ie delete), where there is a matching .pdf in that subfolder location. (reduce size of backups)
So ideally the location/file path will be part of the file name for finding duplicates, as the file name may not necessarily be unique, and then examine the file extension to find "duplicates".
Example files:
1 d:\projects\House1\floorplan.pdf
2 d:\projects\House1\floorplan.tif
3 d:\projects\House2\floorplan.pdf
4 d:\projects\House2\floorplan.tif
5 d:\projects\House2\revised plan\floorplan.tif
6 d:\projects\House3\floorplan.pdf
7 d:\projects\House3\floorplan.tif
Result:
I would only want to find (and then delete) files 2,4&7
I don't want to delete file 5 as there is no matching .pdf in that subfolder...
A bonus would be to include a variable to search only files older than say 3months....
I have no scripting ability, so if someone is able to help, it would need to be the full monty.
Can anyone assist?
Thanks in advance.