Sorting file name from the 12th character
Moderators: white, Hacker, petermad, Stefan2
Sorting file name from the 12th character
I need to sort by file name but I need to ignore the first 12 characters
Can TC do this?
Can TC do this?
regexp_wdx NameCutFirst12 Sort Custom Column
Only that you can't sort by that Custom Column
I wanted to post the same answer:
Add a Column with [=tc.name:13-]
For that syntax see "Here is a description of all available placeholders" at
http://www.ghisler.ch/wiki/index.php/Multi-rename_tool
- - -
Over there is a trick with an additional plugin >
http://ghisler.ch/board/viewtopic.php?p=212332#212332
regexp_wdx
https://totalcmd.net/plugring/regexp_wdx.html
Install that plugin, then edit the INI
...TC\plugins\wdx\regexp\regexp.ini
[Regexp]
Rule=NameCutFirst12
[NameCutFirst12]
Find=^(.){12}(.*)
Change="$2"
Substitute=1
Others=0
Next create a Custom Column with [=regexp.Result]
Here is how to create a Custom Column >
http://ghisler.ch/board/viewtopic.php?p=322029#322029
1: Right-click on the tab headers.
2. Click "Configure custom columns".
3. Click the button "New"
4. In the Name field write e.g. "Sort 13th"
5. Click the "Add column" button.
6.Click the "+" button to the far right.
7. Under Plugins: click "regexp".
8. and select: "Result".
[=regexp.Result]
9. Click OK 3 times.
Or see TC menu "Configuration > Custom columns" and
http://www.ghisler.ch/wiki/index.php/Custom_columns
I wanted to post the same answer:
Add a Column with [=tc.name:13-]
For that syntax see "Here is a description of all available placeholders" at
http://www.ghisler.ch/wiki/index.php/Multi-rename_tool
- - -
Over there is a trick with an additional plugin >
http://ghisler.ch/board/viewtopic.php?p=212332#212332
regexp_wdx
https://totalcmd.net/plugring/regexp_wdx.html
Install that plugin, then edit the INI
...TC\plugins\wdx\regexp\regexp.ini
[Regexp]
Rule=NameCutFirst12
[NameCutFirst12]
Find=^(.){12}(.*)
Change="$2"
Substitute=1
Others=0
Next create a Custom Column with [=regexp.Result]
Here is how to create a Custom Column >
http://ghisler.ch/board/viewtopic.php?p=322029#322029
1: Right-click on the tab headers.
2. Click "Configure custom columns".
3. Click the button "New"
4. In the Name field write e.g. "Sort 13th"
5. Click the "Add column" button.
6.Click the "+" button to the far right.
7. Under Plugins: click "regexp".
8. and select: "Result".
[=regexp.Result]
9. Click OK 3 times.
Or see TC menu "Configuration > Custom columns" and
http://www.ghisler.ch/wiki/index.php/Custom_columns
"filesys" plugin [=filesys.CutNameStart.12] Sort C
Ghislers' "filesys" sample plugin works here too
[=filesys.CutNameStart.12]
Possible values: 0-20
http://ghisler.ch/board/viewtopic.php?p=259748#259748
[=filesys.CutNameStart.12]
Possible values: 0-20
http://ghisler.ch/board/viewtopic.php?p=259748#259748
For the sake of completeness, my PCREsearch plug-in can do this as well.
With PCREsearchConfig.exe create or modify a field and use:
Regular Expression:
or if you want to discard the file extension:
Replace String
Field type
[•]String output
(or "First match string output")
Field options
[✓]Search in filename only
With PCREsearchConfig.exe create or modify a field and use:
Regular Expression:
Code: Select all
^.{12}(.*)
Code: Select all
^.{12}(.*?)(\.[^\.]+)?$
Code: Select all
$1
[•]String output
(or "First match string output")
Field options
[✓]Search in filename only
TC plugins: PCREsearch and RegXtract
Support +++++++I support a wish to sort by visible values.
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: 48130
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The problem with that is that fields like date/time, numeric etc. will then be sorted alphabetically - normally not what you want...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
How about:
Allow to add one column in "Custom Columns" with a special name like "SpecialUserSort".
The content/plugin of that column is not important, only the special name of the column.
If a user use that special column name, he knows what he does (explained in help)
Perhaps additionally disable the possibility to sort the default size and date/time columns
at the same time as long as that "Custom Columns" with that special column is active.
Then we can simply use "[=tc.name:13-]" in that SpecialUserSort" column.
Allow to add one column in "Custom Columns" with a special name like "SpecialUserSort".
The content/plugin of that column is not important, only the special name of the column.
If a user use that special column name, he knows what he does (explained in help)
Perhaps additionally disable the possibility to sort the default size and date/time columns
at the same time as long as that "Custom Columns" with that special column is active.
Then we can simply use "[=tc.name:13-]" in that SpecialUserSort" column.
Thanks for all the replies. My head is spinning on account of the technical fiddling to make this work! I didn't think this would be so awkward!
If I have understood correctly, out of all the options PCREsearch is perhaps the easiest and also most flexible if I want to change the number of ignored characters. However PCREsearch's options look so extensive I don't really know where to start. Other solutions to edit the INI file seem too awkward for fast use.
Here is my requirement in a bit more detail. My initial 12 characters are used to hard code a date-time stamp into the name of my voice-memo files but I want to sort by the remainder of the description after the 12th character and not the date. (Sometimes I may write a date stamp using fewer than 12 characters.)
I can't think of any other file manager more flexible than TC, so I guess I'm a bit stuck.
If I have understood correctly, out of all the options PCREsearch is perhaps the easiest and also most flexible if I want to change the number of ignored characters. However PCREsearch's options look so extensive I don't really know where to start. Other solutions to edit the INI file seem too awkward for fast use.
Here is my requirement in a bit more detail. My initial 12 characters are used to hard code a date-time stamp into the name of my voice-memo files but I want to sort by the remainder of the description after the 12th character and not the date. (Sometimes I may write a date stamp using fewer than 12 characters.)
I can't think of any other file manager more flexible than TC, so I guess I'm a bit stuck.
Add Custom Column with [=filesys.CutNameStart.13]
This is the easiest way for you:
1) Download the plugin
https://plugins.ghisler.com/content/wdx_filesys.zip
Save it to your local download folder.
2) Inside of TC, go to that download folder and double click the ZIP file:
Click at Yes.
(I think you do not have to close and restart TC, but do it if it doesn't work)
Next create a Custom Column with [=filesys.CutNameStart.13] (Possible values: 0-20)
1: Right-click on the tab headers.
2. Click "Configure custom columns".
3. Click the button "New"
4. In the Name field write e.g. "Sort at 13th"
5. Click the "Add column" button.
6.Click the "+" button to the far right.
7. Under Plugins: click "filesys >".
8. and select: "CutNameStart > 13".
You may have to adjust the number, possible values are 0 to 20.
You may also want to add "tc > writedate <default>", "tc > size <default>" and "tc > attributestr" to complete the view.
9. Click OK 3 times.
Now you have a column named "Sort at 13th" on which you can click to sort.
If you are done, Right-click on the tab headers and chose "Full View" again for the normal, default columns.
- - -
EXAMPLE:
CustomColumn with WDX-plugin "filesys"
Using plugin parameter: "filesys.CutNameStart.4".
Result: start filename at 5th sign.
Also that CustomColumn can be sorted by clicking at the column header.
Sorted default by Name coulmn:
.
1) Download the plugin
https://plugins.ghisler.com/content/wdx_filesys.zip
Save it to your local download folder.
2) Inside of TC, go to that download folder and double click the ZIP file:
Code: Select all
---------------------------
wdx_filesys.zip
---------------------------
This archive contains the following Total Commander plugin/addon:
filesys sample plugin v2.3 (ANSI+Unicode)
Do you want to install it?
---------------------------
Ja Nein
---------------------------
(I think you do not have to close and restart TC, but do it if it doesn't work)
Next create a Custom Column with [=filesys.CutNameStart.13] (Possible values: 0-20)
1: Right-click on the tab headers.
2. Click "Configure custom columns".
3. Click the button "New"
4. In the Name field write e.g. "Sort at 13th"
5. Click the "Add column" button.
6.Click the "+" button to the far right.
7. Under Plugins: click "filesys >".
8. and select: "CutNameStart > 13".
You may have to adjust the number, possible values are 0 to 20.
You may also want to add "tc > writedate <default>", "tc > size <default>" and "tc > attributestr" to complete the view.
9. Click OK 3 times.
Now you have a column named "Sort at 13th" on which you can click to sort.
If you are done, Right-click on the tab headers and chose "Full View" again for the normal, default columns.
- - -
EXAMPLE:
CustomColumn with WDX-plugin "filesys"
Using plugin parameter: "filesys.CutNameStart.4".
Result: start filename at 5th sign.
Also that CustomColumn can be sorted by clicking at the column header.
Code: Select all
Name: | filesys.CutNameStart.4
-------------------------------------------------------------------
JustAsexample.txt Asexample.txt
LastButnotleast.txt Butnotleast.txt
TestC-Kopie.txt C-Kopie.txt
1234DjustATest.txt DjustATest.txt
Afilename is this.txt ename is this.txt
AnotHername is here.txt Hername is here.txt
ZepelinTest- Kopie.txt linTest- Kopie.txt
TestTheplugin.txt Theplugin.txt
Sorted default by Name coulmn:
Code: Select all
Name: | filesys.CutNameStart.4
-------------------------------------------------------------------
1234DjustATest.txt DjustATest.txt
Afilename is this.txt ename is this.txt
AnotHername is here.txt Hername is here.txt
JustAsexample.txt Asexample.txt
LastButnotleast.txt Butnotleast.txt
TestC-Kopie.txt C-Kopie.txt
TestTheplugin.txt Theplugin.txt
ZepelinTest- Kopie.txt linTest- Kopie.txt