[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: reorder files with a mouse in a file browser and rename them

On 06/09/2007 11:28 PM, H.S. wrote:
I am looking for a method to drag and move file1.jpg to the bottom of the list and then to rename them based on a file pattern to get

Only that I do not have only three files, a few hundred of them.

Use drag and drop to move the files into another directory, the execute a script like this in that directory:

ls -U file*.jpg | while read filename
    count=$(( $count+1 ))
    fcount=`printf "%03d" $count`
    echo mv $filename ${fcount}_$filename

If you want to use this script, you should test it with the "echo" still in there. Then you can get rid of the "echo" when you're sure the script works correctly.

I hope this helps.

Reply to: