I have a folder with several text files, whose name is a progressive number followed by underscore and the customer name, i.e.
000127_Porsche
000158_Maserati
000187_Porsche
000201_Ferrari
and so on...
I'd like to have them sorted starting from the Nth character, in this case N=8
000201_Ferrari
000158_Maserati
000127_Porsche
000187_Porsche
Right now I'm using a filter but I have to change it every time
thank you
Sort files by Nth character
Moderators: white, Hacker, petermad, Stefan2
Sort files by Nth character
/-\ /\/\ /\/\ /-\ /\/\ /\/\ /-\ T /-\
Re: Sort files by Nth character
I don't if this workaround is workable for you but you could do this:
Create a custom column for comments (because normal comment view cannot be sorted on comments)
Field contents: [=tc.comment]
Then copy the filenames starting from the 8th character to the comment.
Mark all your files and choose menu File/Change Attributes.
Check Change plugin attributes.
Plugin: tc
Property: comment
Value: [=tc.fullname:8-]
Create a custom column for comments (because normal comment view cannot be sorted on comments)
Field contents: [=tc.comment]
Then copy the filenames starting from the 8th character to the comment.
Mark all your files and choose menu File/Change Attributes.
Check Change plugin attributes.
Plugin: tc
Property: comment
Value: [=tc.fullname:8-]
Re: Sort files by Nth character
Also there are
expander2 : http://www.ghisler.ch/board/viewtopic.php?p=151622#151622 _ _ split e.g. at " - " -signs for to show parts of the filename in different custom columns.
Regexp_wdx : https://www.ghisler.ch/board/viewtopic.php?p=93548#p93548 _ _ split filename with regular expressions for to show parts of the filename in different custom columns.
and FileSys : https://www.ghisler.ch/board/viewtopic.php?p=326052#p326052 _ _ start filename in custom column e.g. at 5th char with "filesys.CutNameStart.4" for to sort filenames at that spot.
HTH?
expander2 : http://www.ghisler.ch/board/viewtopic.php?p=151622#151622 _ _ split e.g. at " - " -signs for to show parts of the filename in different custom columns.
Regexp_wdx : https://www.ghisler.ch/board/viewtopic.php?p=93548#p93548 _ _ split filename with regular expressions for to show parts of the filename in different custom columns.
and FileSys : https://www.ghisler.ch/board/viewtopic.php?p=326052#p326052 _ _ start filename in custom column e.g. at 5th char with "filesys.CutNameStart.4" for to sort filenames at that spot.
HTH?
Re: Sort files by Nth character
You mean [=filesys.CutNameStart.7]? That wouldn't do any good. TC only sorts on (full) fieldname.Stefan2 wrote: ↑2022-08-30, 13:32 UTC and FileSys : https://www.ghisler.ch/board/viewtopic.php?p=326052#p326052 _ _ start filename in custom column e.g. at 5th char with with "filesys-CutNameStart:4"
Re: Sort files by Nth character
It seems to me that [=filesys.CutNameStart.7] does work, because the unit 7 is intrinsic to the plugin (unit values 0 - 20).You mean [=filesys.CutNameStart.7]? That wouldn't do any good. TC only sorts on (full) fieldname.
Maybe you are thinking of using [=filesys.CutNameStart:8-] - it will show the same as [=filesys.CutNameStart.7] but since it is TC making the substring, TC will still sort by the full fieldname.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 48083
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Sort files by Nth character
Indeed [=filesys.CutNameStart.7] is meant for sorting, so I recommend that you use it for your purpose. You can make that extra column very narrow, just so you can click on the header.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com