Script to Delete Alternate Files?
Posted on 2011-05-07
Would someone mind creating a Powershell script that will delete alternate files in a directory for me please?
I've been saving timelapse images every 20 seconds (using iSpyConnect) of an extension to my house that is being built. I've then used Quicktime Pro to combine these images into a movie each week, but now I want to combine multiple weeks into one large timelapse movie.
The problem is I have 1000's of images, and even running at 60fps results in a video that is too long. I would therefore like to delete every second OR third file in an automated way rather than manually selecting files myself, which would take ages. :)
For example, I have a directory with images named in numerical order based on the date they were created.
I would like to delete files named 2, 4, 6, and so on throughout the whole directory, which at the moment contains over 10,000 images! If I find that deletes too many, I would also like the option to delete every third file as well please - 3, 6, 9, etc.
Many thanks in advance for your help.