Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-01-16 09:33:00

michaelsf
Member
Registered: 2014-01-16
Posts: 14

Thunar sorting by digit not number (like normal "ls"-command)

Hi, (I'm using Thunar 1.6.3 on Xubuntu 13.10.)

I have about 7000 pictures, videos and text-files with filenames starting with the date and ending in different useful ways. Now the actual sorting in thunar is not helpful to me, as it treats filenames with digits as complete numbers and not as single characters. 

What I need is an option to switch the sorting to a "normal" "ls"-sorting like "sort by single characters/digits", e.g.:

At the moment it looks e.g. like this:
20130923-kitchen.txt
20130805458.jpg
201303081250-DSC06099.JPG
2013020816273-IMG_0568.mpg
20130617175949.jpg

should be:
2013020816273-IMG_0568.mpg
201303081250-DSC06099.JPG
20130617175949.jpg
20130805458.jpg
20130923-kitchen.txt

Is there a way to add this option to thunar?

((((solved: Or is there a way to fill up the "to short numbers" with 0s up to 14digits for all 7000 files in different subdirectories e.g. with a command line like mv RegularExpression so it looks at the end like:
20130208162730-IMG_0568.mpg
20130308125000-DSC06099.JPG
20130617175949.jpg
20130805458000.jpg
20130923000000-kitchen.txt
?
Any help would be appreciated (any RegExp-gurus out there? ;-) )))

Thanks,
michael

Last edited by michaelsf (2014-01-18 11:14:58)


-- just a beginner ...

Offline

#2 2014-01-16 11:11:20

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: Thunar sorting by digit not number (like normal "ls"-command)

You could probably do a batch-rename script to remove the numbers from the beginning of all the file names. Then you could sort the files by date - file attribute or metadata - and gain the ability to sort them by the part of their (current) filenames which isn't date-related. Might be easier to read at that point as well.

BtW, having all those different types of files in the same directory seems a bit unwieldy to me. Was that done by design or did it just sort of happen over time?

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#3 2014-01-17 10:55:09

michaelsf
Member
Registered: 2014-01-16
Posts: 14

Re: Thunar sorting by digit not number (like normal "ls"-command)

MountainDewManiac wrote:

You could probably do a batch-rename script to remove the numbers from the beginning of all the file names. Then you could sort the files by date - file attribute or metadata - and gain the ability to sort them by the part of their (current) filenames which isn't date-related. Might be easier to read at that point as well.

Some of the files got changed file-dates because of some changes to the files and many have no metadata, but I got a shell-script to rename them as I did wish, now. The sort-option in Thunar would still be my favorite wish, but I can live with renaming all the files, now.

MountainDewManiac wrote:

BtW, having all those different types of files in the same directory seems a bit unwieldy to me. Was that done by design or did it just sort of happen over time?

It's a kind of very easy to use portfolio/diary, which needs no extra software and fulfills all my needs. Everything is related to the relevant date (and not the filetype, or the date I did change something on the file), so e.g. all the stuff from a party (pictures from different cameras, videos, text-messages and my own report about it) are in the right order in the right place. So i can easily flip through certain events or days no matter what filetype it is. e.g. a summary text of the month only had 201311.txt (Now 20131100000000.txt ;-)) and is followed by different files for the following dates...

It's all a matter of how you use your data... ;-)

Regards,
michael

P.S. The script (in German) for renaming the files can be found here: http://forum.ubuntuusers.de/topic/thuna … fern-aend/

Last edited by michaelsf (2014-01-17 11:03:00)


-- just a beginner ...

Offline

#4 2014-01-18 00:46:15

ozjd
Member
From: Hawkesbury NSW Australia
Registered: 2012-02-05
Posts: 560
Website

Re: Thunar sorting by digit not number (like normal "ls"-command)

I use a similar file naming and don't have an issue with the order in Thunar or other file managers. The difference is I separate the year with a '_' so files look like 2013_0118Name0001.jpg, i.e. YYYY_MMDDNameNum.ext. Sorting treats the year and monthday as 2 complete numbers and so works as I expect.

Offline

#5 2014-01-18 23:39:28

andrzejr
Member
Registered: 2012-04-06
Posts: 48

Re: Thunar sorting by digit not number (like normal "ls"-command)

This is a feature (I do realize not the one you want) - any numbers file names are treated as numbers, not as text.

So thunar is sorting the following files as:

file_1
file_2
...
file_10

and not as:

file_1
file_10
file_2
...

Unfortunately this does not work in your use case (you would need a simple text-based sort) but overall it's a useful feature in most situations.

By the way, this is not an Xfce invention, it comes from glib (g_utf8_collate_key_for_filename).

Offline

#6 2014-01-19 17:27:15

michaelsf
Member
Registered: 2014-01-16
Posts: 14

Re: Thunar sorting by digit not number (like normal "ls"-command)

Yes, I know, yes, yes, yes, but this doesn't help me at all. So all I'm asking for is having an option to choose which way of sorting files the user prefer. It's OK if the current sorting in thunar is the default, but an option somehow/somewhere to switch it to simple text-based-sorting, would be more user friendly and would really make my day... :-)

Last edited by michaelsf (2014-01-19 17:27:54)


-- just a beginner ...

Offline

Board footer

Powered by FluxBB