[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 Sun, Jun 10, 2007 at 12:28:18AM -0400, H.S. wrote:
> Joe wrote:
> 
> >
> >Both Nautilus and Konqueror do it exactly the same way as Windows
> >Explorer, click once in a heading to sort by that heading, click again
> >to reverse the sort. The heading will show a small arrow pointing up
> >or down according to the sort direction. You do need to use list view,
> >rather than the icon view.
> 
> Perhaps you misunderstood. I do not want a global reordering, I just 
> want to place individual files at certain positions and then rename them 
> in that new order. For example, say I have:
> file1.jpg
> file2.jpg
> file3.jpg
> 
> and I wish to have the following order
> file2.jpg
> file3.jpg
> file1.jpg
> 
> 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
> 001_file2.jpg
> 002_file3.jpg
> 003_file1.jpg
> 
> Only that I do not have only three files, a few hundred of them.
> 
> ->HS
an idea:
ls *.jpg > filelist.txt
then edit filelist.txt and reorder the filenames until done
the run:
sh renamescript.sh filelist.txt
where renamescript.sh is:
-------------------------------
FILES=$1
I=1001
cat $FILES|while read filename; do 
        N=$(echo $I|cut -c2-)
        echo mv "$filename" "$N""_""$filename"
        I=$(( $I + 1 ))
done
-------------------------------------
remove 'echo' for the real script.
-K
-- 
|  .''`.  == Debian GNU/Linux == |       my web site:           |
| : :' :      The  Universal     |mysite.verizon.net/kevin.mark/|
| `. `'      Operating System    | go to counter.li.org and     |
|   `-    http://www.debian.org/ |    be counted! #238656       |
|  my keyserver: subkeys.pgp.net |     my NPO: cfsg.org         |
|join the new debian-community.org to help Debian!              |
|_______  Unless I ask to be CCd, assume I am subscribed _______|



Reply to: