View Single Post
Old 06-22-2012, 08:49 AM   #16
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Mmmmm, I'm doing my best at understanding all you wrote!
(I always marvel at how noob I am!!!)

Currently, the rename script acts like this:

- analyzes the file name from the end finding al numbers
- keeps first sequence of number after the extension: in 03_001 it keeps 001
- sorts files with that sequence

That's why it has problems if files have more than one name pattern.

In the first example (03_XXX and CreditsXX) it tries to sort files after adding the first column:

000 03_000a.jpg
000 03_000b.jpg
000 03_000c.jpg
001 03_001.png
002 03_002.png
003 03_003.png
005 03_004-005.png
006 03_006.png
007 03_007.png
008 03_008.png
009 03_009.png
010 03_010.png
011 03_011.png
012 03_012.png
013 03_013.png
10 Credits10.png
11 Credits11.png

and that's why it places Credits10 after 03_010 and Credits11 after 03_011!!

I'm trying to reproduce windows' sort-by-name....but I'm not so good at shell scripting!

EDIT: I could cut the file list in pieces based on the filename. Than sort every piece and join the results...just thinking...

Last edited by silver18; 06-22-2012 at 08:54 AM.
silver18 is offline   Reply With Quote