Re: reorder files with a mouse in a file browser and rename them
H.S. wrote: Ron Johnson wrote: On 06/09/07 23:29, H.S. wrote: [snip] Last time I checked, it did not support reordering the files using drag and drop. It only supported up and down arrow keys; which can be quite a drag if I have many files! Just out of curiosity: what is the "root problem" you are trying to solve? Get them in date-order, maybe? Yes, to get the proper time-line. These are many image files which were scanned from negatives but not in proper order. ->HS gthumb image viewer/organizer/manager sorts images by time and can do mass renaming using a pattern ###filename.jpg where # is a digit starting at a given number, images can be cataloged all using a gui and mouse. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
> > This may be a little odd question. Can any of the file browsers > > (konqueror, nautilus) let a user reorder the files in a folder by > > dragging them to a certain position and then to rename the ordered files > > automatically with a file pattern? > > You can do this very easy with the ng-xim program. > http://www.sign-el-soft.hu/cgi/ng-xim.en.html > 1. Press Ctrl-d, and enter into the desired directory. > http://www.sign-el-soft.hu/cgi/ng-xim.en.html#filedirrend > 2. Press Shift+F12 (or select small pictures mode from the view menu). So > you can drag the pictures, and make the desired order. > http://www.sign-el-soft.hu/cgi/ng-xim.en.html#kepbemutatolista > 3. Press F5 (or select copy move rename from file menu). Select rename and > giv the file name as NameWhatYouWant-%+(001).jpg > http://www.sign-el-soft.hu/cgi/ng-xim.en.html#filecopy When the order is done by drag and drop using the thumbnail view, you can change to single picture mode with a mouse click on a small picture. You can check the order as a movie in single picture mode by pressing up or down arrow keys. The next click on the picture will return to the thumbnail view. If the jpg files are in number of folders, you can see them together by opening the parent directory with a right mouse click. With file name %+(001)_%d_%f%e you can replace them into a new directory together. ( %+(001):count up, %d:directory name, %f:file name, %e:ext name ) dir1/a.jpg -> 001_dir1_a.jpg dir1/c.jpg -> 002_dir1_c.jpg dir1/b.jpg -> 003_dir1_b.jpg dir2/c.jpg -> 004_dir2_c.jpg dir2/a.jpg -> 005_dir2_a.jpg dir2/b.jpg -> 006_dir2_b.jpg If you use the pictures many times, copy them into a collection. So you can get a lot of other possibilities.
Re: reorder files with a mouse in a file browser and rename them
Ron Johnson wrote: Once you get them renamed to event_hhmmss.jpeg, a script can rename them to event_.jpeg, if you want. Oh yes, that I am sure about since the project began. I work with shell scripts on a daily basis so this is a no brainer. :) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
H.S. wrote: Hello, This may be a little odd question. Can any of the file browsers (konqueror, nautilus) let a user reorder the files in a folder by dragging them to a certain position and then to rename the ordered files automatically with a file pattern? This problem arose because I have a few hundred of images which are jumbled up in time order. I have seen a friend do something similar in XP's Windows Explorer. I am hoping it can be done in Linux too in some way: order the image files by dragging them to their position in the file browser and to run a script on the newly ordered files to rename them numerically in that order. thanks, ->HS Just in case all the images have EXIF information in them, the task can be done quite easily with exiv2. Looking at the exiv2 man page I found the following in the EXAMPLES section: exiv2 rename img_1234.jpg Renames img_1234.jpg (taken on 13-Nov-05 at 22:58:31) to 20051113_225831.jpg exiv2 -r’:basename:_%Y%m’ rename img_1234.jpg Renames img_1234.jpg to img_1234_200511.jpg This may not be a solution to the particular problem, but with EXIF and exiv2 ordering a bunch of images is quite easy. /KS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
H.S. wrote: >> >> file2.txt >> file3.txt >> file1.txt >> Assume that you were somehow able to generate this list. In real life problem, this would be couple hundred lines long (not just 3 lines). Call this listA. >> to >> >> 001_file2.txt >> 002_file3.txt >> 003_file1.txt > Call this listB. Let's see how listA can be changed to listB inside vim. $cat temp.txt file2.txt file3.txt file1.txt file5.txt file9.txt file10.txt file8.txt $cp temp.txt temp1.txt open temp1.txt in normal mode, put your cursor in line 1, column 1. Now enter the following letters. i001_| qavf_yjPh|q [EMAIL PROTECTED] :w after this you should have temp1.txt as $cat temp1.txt 001_file2.txt 002_file3.txt 003_file1.txt 004_file5.txt 005_file9.txt 006_file10.txt 007_file8.txt $paste temp.txt temp1.txt > temp2.txt $cat temp2.txt file2.txt 001_file2.txt file3.txt 002_file3.txt file1.txt 003_file1.txt file5.txt 004_file5.txt file9.txt 005_file9.txt file10.txt 006_file10.txt file8.txt 007_file8.txt now open temp2.txt in normal mode in vim, put the cursor at line 1, column 1. enter the following commands G I mv :w $cat temp2.txt mv file2.txt001_file2.txt mv file3.txt002_file3.txt mv file1.txt003_file1.txt mv file5.txt004_file5.txt mv file9.txt005_file9.txt mv file10.txt 006_file10.txt mv file8.txt007_file8.txt Voila! your script is ready. You can add #! /bin/sh at the top of temp2.txt and make it executable. It can be run by ./temp2.txt inside bash. Explanation of some of the vim commands. i001_| insets 001_ and moves the cursor to the begining of the line. qavf_yjPh|q record some commands in register a. [EMAIL PROTECTED] execute the commands in register a, 5 times. If the number of files in listA is 100, you will do [EMAIL PROTECTED] instead of [EMAIL PROTECTED] :w write the file. hth raju -- Kamaraju S Kusumanchi http://www.people.cornell.edu/pages/kk288/ http://malayamaarutham.blogspot.com/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
Idézet H.S. 2007. június 9. 05.47 keltezésű leveléből: > This may be a little odd question. Can any of the file browsers > (konqueror, nautilus) let a user reorder the files in a folder by > dragging them to a certain position and then to rename the ordered files > automatically with a file pattern? You can do this very easy with the ng-xim program. http://www.sign-el-soft.hu/cgi/ng-xim.en.html 1. Press Ctrl-d, and enter into the desired directory. http://www.sign-el-soft.hu/cgi/ng-xim.en.html#filedirrend 2. Press Shift+F12 (or select small pictures mode from the view menu). So you can drag the pictures, and make the desired order. http://www.sign-el-soft.hu/cgi/ng-xim.en.html#kepbemutatolista 3. Press F5 (or select copy move rename from file menu). Select rename and giv the file name as NameWhatYouWant-%+(001).jpg http://www.sign-el-soft.hu/cgi/ng-xim.en.html#filecopy Gabor Nagy
Re: reorder files with a mouse in a file browser and rename them
Kamaraju S Kusumanchi wrote: H.S. wrote: Hello, This may be a little odd question. Can any of the file browsers (konqueror, nautilus) let a user reorder the files in a folder by dragging them to a certain position and then to rename the ordered files automatically with a file pattern? This problem arose because I have a few hundred of images which are jumbled up in time order. I have seen a friend do something similar in XP's Windows Explorer. I am hoping it can be done in Linux too in some way: order the image files by dragging them to their position in the file browser and to run a script on the newly ordered files to rename them numerically in that order. thanks, ->HS Dont use GUI for this sort of thing. Write a shell script which contains all the necessary commands for performing the task. To get list of files, use vim. You probably need to use commands such as :!ls -rt *jpg inside vim. Once the list is generated in your desired order, then generate the list of new file names. changing file2.txt file3.txt file1.txt to 001_file2.txt 002_file3.txt 003_file1.txt The example I gave above was trivial to say the least. is pretty trivial in vim if you know about registers etc., I know I am not If you could elaborate on that a bit, it would be helpful to understand what you mean. But keep in mind that we are talking about some hundreds of files which appear in random order and one cannot judge where a file is supposed to be in a time line without first looking at the image file. ->HS giving you complete answers, but those pointers should help you to get started. hth raju -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
H.S. wrote: > Hello, > > This may be a little odd question. Can any of the file browsers > (konqueror, nautilus) let a user reorder the files in a folder by > dragging them to a certain position and then to rename the ordered files > automatically with a file pattern? > > This problem arose because I have a few hundred of images which are > jumbled up in time order. I have seen a friend do something similar in > XP's Windows Explorer. I am hoping it can be done in Linux too in some > way: order the image files by dragging them to their position in the > file browser and to run a script on the newly ordered files to rename > them numerically in that order. > > thanks, > ->HS Dont use GUI for this sort of thing. Write a shell script which contains all the necessary commands for performing the task. To get list of files, use vim. You probably need to use commands such as :!ls -rt *jpg inside vim. Once the list is generated in your desired order, then generate the list of new file names. changing file2.txt file3.txt file1.txt to 001_file2.txt 002_file3.txt 003_file1.txt is pretty trivial in vim if you know about registers etc., I know I am not giving you complete answers, but those pointers should help you to get started. hth raju -- Kamaraju S Kusumanchi http://www.people.cornell.edu/pages/kk288/ http://malayamaarutham.blogspot.com/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
On 06/10/07 11:15, H.S. wrote: Ron Johnson wrote: The way that I would do it is: As you view an image in one window, use exiv2 in another window to add (or change) the exif timestamp. It would require extremely huge amount of time -- doing this by hand for every file and all. With bash and the "up arrow", it doesn't seem to me that this would take a lot of time. Also, the jpegs do not have an exiv2 header in them (at least not that I know of; scanned from negatives), but I would suppose it is easy to add an empty header via a shell script. :) Remember, even though Linux has GUI, most "Unix people" don't reflexively go for the GUI solution. (Then, after doing that to all the files, I would use exiv2 to rename them based upon the timestamp. But that's just me.) I don't know is MS Windows "resets" the file order when you log off or change directories thus forcing you not to be able to do anything else in Explorer until you complete that task, but the method I propose definitely does not force you to keep that window open the whole time. Well, how I get around this problem is to distribute the images in a number of folders (around 20 in my case) based on the time-line (or event) once. This is done by drag and drop using the thumbnail view. Clever. If it helps, Nautilus has a thumbnail viewer. (As does, presumably, Konq.) gqview is also *perfect* for such a task. That way I just have to sort contents of one folder at a time (involving around 20~60 or so images). This makes the problem much more tractable in Windows. It seems to me that this is a messy problem no matter which OS you use. Within that one folder, I drag and drop the images into their proper order and then rename them (they get renamed in the order I had placed them) so that they have a name something like event_.jpeg where is a sequence starting from 0001. Once you get them renamed to event_hhmmss.jpeg, a script can rename them to event_.jpeg, if you want. -- Ron Johnson, Jr. Jefferson LA USA Give a man a fish, and he eats for a day. Hit him with a fish, and he goes away for good! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
Ron Johnson wrote: The way that I would do it is: As you view an image in one window, use exiv2 in another window to add (or change) the exif timestamp. It would require extremely huge amount of time -- doing this by hand for every file and all. Also, the jpegs do not have an exiv2 header in them (at least not that I know of; scanned from negatives), but I would suppose it is easy to add an empty header via a shell script. (Then, after doing that to all the files, I would use exiv2 to rename them based upon the timestamp. But that's just me.) I don't know is MS Windows "resets" the file order when you log off or change directories thus forcing you not to be able to do anything else in Explorer until you complete that task, but the method I propose definitely does not force you to keep that window open the whole time. Well, how I get around this problem is to distribute the images in a number of folders (around 20 in my case) based on the time-line (or event) once. This is done by drag and drop using the thumbnail view. That way I just have to sort contents of one folder at a time (involving around 20~60 or so images). This makes the problem much more tractable in Windows. Within that one folder, I drag and drop the images into their proper order and then rename them (they get renamed in the order I had placed them) so that they have a name something like event_.jpeg where is a sequence starting from 0001. ->HS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
On 06/10/07 09:28, H.S. wrote: Ron Johnson wrote: On 06/09/07 23:29, H.S. wrote: [snip] Last time I checked, it did not support reordering the files using drag and drop. It only supported up and down arrow keys; which can be quite a drag if I have many files! Just out of curiosity: what is the "root problem" you are trying to solve? Get them in date-order, maybe? Yes, to get the proper time-line. These are many image files which were scanned from negatives but not in proper order. The way that I would do it is: As you view an image in one window, use exiv2 in another window to add (or change) the exif timestamp. (Then, after doing that to all the files, I would use exiv2 to rename them based upon the timestamp. But that's just me.) I don't know is MS Windows "resets" the file order when you log off or change directories thus forcing you not to be able to do anything else in Explorer until you complete that task, but the method I propose definitely does not force you to keep that window open the whole time. -- Ron Johnson, Jr. Jefferson LA USA Give a man a fish, and he eats for a day. Hit him with a fish, and he goes away for good! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
Ron Johnson wrote: On 06/09/07 23:29, H.S. wrote: [snip] Last time I checked, it did not support reordering the files using drag and drop. It only supported up and down arrow keys; which can be quite a drag if I have many files! Just out of curiosity: what is the "root problem" you are trying to solve? Get them in date-order, maybe? Yes, to get the proper time-line. These are many image files which were scanned from negatives but not in proper order. ->HS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
On 06/09/07 23:29, H.S. wrote: [snip] Last time I checked, it did not support reordering the files using drag and drop. It only supported up and down arrow keys; which can be quite a drag if I have many files! Just out of curiosity: what is the "root problem" you are trying to solve? Get them in date-order, maybe? -- Ron Johnson, Jr. Jefferson LA USA Give a man a fish, and he eats for a day. Hit him with a fish, and he goes away for good! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
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 001_file2.jpg 002_file3.jpg 003_file1.jpg 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: --- #!/bin/bash count=0 ls -U file*.jpg | while read filename do count=$(( $count+1 )) fcount=`printf "%03d" $count` echo mv $filename ${fcount}_$filename done --- 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. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
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 ___| -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
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 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
Stephen Cormier wrote: On June 9, 2007 12:47:46 am H.S. wrote: Hello, This may be a little odd question. Can any of the file browsers (konqueror, nautilus) let a user reorder the files in a folder by dragging them to a certain position and then to rename the ordered files automatically with a file pattern? This problem arose because I have a few hundred of images which are jumbled up in time order. I have seen a friend do something similar in XP's Windows Explorer. I am hoping it can be done in Linux too in some way: order the image files by dragging them to their position in the file browser and to run a script on the newly ordered files to rename them numerically in that order. You might want to check krename you can select the files in konqueror right click and under the actions menu use krename, it allows for regular expressions when doing the renaming depending on how the files are now named I'm not sure if it will totally do what you want but it is worth a try. Last time I checked, it did not support reordering the files using drag and drop. It only supported up and down arrow keys; which can be quite a drag if I have many files! ->HS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
Mathias Brodala wrote: Ah, yes. You cannot reorder files’ positions within Bulk Renamer’s list. (I will file a feature request for this if there isn’t already one.) Thank you. ->HS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
On June 9, 2007 12:47:46 am H.S. wrote: > Hello, > > This may be a little odd question. Can any of the file browsers > (konqueror, nautilus) let a user reorder the files in a folder by > dragging them to a certain position and then to rename the ordered files > automatically with a file pattern? > > This problem arose because I have a few hundred of images which are > jumbled up in time order. I have seen a friend do something similar in > XP's Windows Explorer. I am hoping it can be done in Linux too in some > way: order the image files by dragging them to their position in the > file browser and to run a script on the newly ordered files to rename > them numerically in that order. You might want to check krename you can select the files in konqueror right click and under the actions menu use krename, it allows for regular expressions when doing the renaming depending on how the files are now named I'm not sure if it will totally do what you want but it is worth a try. > thanks, > ->HS Your welcome, Stephen -- GPG Public Key: http://users.eastlink.ca/~stephencormier/publickey.asc signature.asc Description: This is a digitally signed message part.
Re: reorder files with a mouse in a file browser and rename them
H.S. wrote: Mathias Brodala wrote: Hi. H.S., 09.06.2007 05:47: This may be a little odd question. Can any of the file browsers (konqueror, nautilus) let a user reorder the files in a folder by dragging them to a certain position and then to rename the ordered files automatically with a file pattern? Thunar can: "thunar --bulk-rename". Regards, Mathias Can I fix the files' order using a mouse? I just tried but couldn't. So haven't given a shot to the bulk rename either yet. Or maybe I am just missing something. 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. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
Hi. H.S., 09.06.2007 18:22: > Mathias Brodala wrote: >> Hi. >> >> H.S., 09.06.2007 05:47: >>> This may be a little odd question. Can any of the file browsers >>> (konqueror, nautilus) let a user reorder the files in a folder by >>> dragging them to a certain position and then to rename the ordered files >>> automatically with a file pattern? >> >> Thunar can: "thunar --bulk-rename". > > Can I fix the files' order using a mouse? I just tried but couldn't. So > haven't given a shot to the bulk rename either yet. Or maybe I am just > missing something. Ah, yes. You cannot reorder files’ positions within Bulk Renamer’s list. (I will file a feature request for this if there isn’t already one.) Regards, Mathias -- debian/rules signature.asc Description: OpenPGP digital signature
Re: reorder files with a mouse in a file browser and rename them
Mathias Brodala wrote: Hi. H.S., 09.06.2007 05:47: This may be a little odd question. Can any of the file browsers (konqueror, nautilus) let a user reorder the files in a folder by dragging them to a certain position and then to rename the ordered files automatically with a file pattern? Thunar can: "thunar --bulk-rename". Regards, Mathias Can I fix the files' order using a mouse? I just tried but couldn't. So haven't given a shot to the bulk rename either yet. Or maybe I am just missing something. ->HS -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: reorder files with a mouse in a file browser and rename them
Hi. H.S., 09.06.2007 05:47: > This may be a little odd question. Can any of the file browsers > (konqueror, nautilus) let a user reorder the files in a folder by > dragging them to a certain position and then to rename the ordered files > automatically with a file pattern? Thunar can: "thunar --bulk-rename". Regards, Mathias -- debian/rules signature.asc Description: OpenPGP digital signature