So since I'm looking for an easy way to numberize files in a folder according to date:
Is there an easy script (batch, windows), that will rename files like this:
.earliest creation time: 001.file
older creatiin time : 002.file
even older time : 003.file
....
...
..
.
I have a few to questions pose in response first:-
Is this homework/assignment? There are specific forums for these.
What have you tried so far?
What output/errors do you get?
What OS and version are you using?
What are your preferred tools? (C, shell, perl, awk, etc.)
What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?
Assuming that you have less than 1000 files, you could:-
Set up a three digit counter padded with leading zeros
List the files sort in date order, oldest first (reversed to normal date order) using ls -1rt
Use this list as input to a loop to rename each source file in turn to the appropriate numbered file
Increment the counter and go round the loop to the end of the list.
There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.
We're all here to learn and getting the relevant information will help us all.
i merly had imagemagick hack an animated gif into mutiple frames,
edited em w imagemagik and tried to compile as vid with ffmpeg,
but...
sadly the order in the video is wrong
(it jumps from frame 1 to 10 etc)
Thats why I want to rename the files to 0001 0002... to prevent jumping.
Show us the script you're using to get 1.file ... 9.file10.file ... and we'll show you how to simply modify it to produce numbers with a specified number of digits with leading zeros. Note that something like:
printf '%04d.file' $number
is likely to be at the heart of it (for four digit sequence numbers).
Ordering by date may not be reliable on extremely small time scales, many implementations only store date to the second. Just moving 1-9, 10-99, 100-999 etc to appropriate four-digit numbers with leading zeroes may be easier. This would be very simple in BASH but excruciatingly difficult in Windows CMD, could you use busybox.exe ?