Page 1 of 2
Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 16:23
by renamerbrian
Hi!
I love this program. This might sound dumb but I can't find the solution.
I need to first sort by Date Created. This is fairly straight forward.
I then need to have the folder names in alphabetical order so I can keep similarly named properties together......but I need to see which one of those is the newest.
Example:
Bank1 Main Street
Bank1 Second Street
Bank2 Orange Street
Bank2 Maple Drive
I need to sort to see which Bank2 is the newest....but I need to keep all Bank2s together....if I sort by Date Created obviously it lists ALL the many folders in this order.... I need to keep them grouped together by name but have them in Date Created order
Hope this makes sense.
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 16:29
by highend
This would require a scripted custom column...
Execute
snippet; from the address bar and then paste this source code into it:
Code: Select all
Snip: CustomColumn 1
XYplorer 23.70.0112, 14.10.2022 16:36:18
Action
ConfigureColumn
Caption
Bank folders sortable
Type
3
Definition
if (regexmatches(<cc_name>, "^bank")) {
return property("#date.m", <cc_item>);
}
Format
0
Trigger
0
Item Type
1
Item Filter
and then you can sort that column...
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 16:42
by renamerbrian
Thanks for the fast reply!!!!!!!!!!
I want to do this for ALL the folders in a given directory....the "Bank" was just an example.
What would I have to modify?
You're the best!
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 16:49
by highend
Why don't you say that in the first place?
Configuration | General | Sort and Rename | Sort | Keep folders on top
Sort by "Name" first, hold shift, click on the "Created" column...
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 17:02
by renamerbrian
highend wrote: ↑14 Oct 2022 16:49
Why don't you say that in the first place?
Configuration | General | Sort and Rename | Sort | Keep folders on top
Sort by "Name" first, hold shift, click on the "Created" column...
I had tried this originally.
If I click by Name it definitely sorts them in order. When I hold the Shift key and hit Date Created the arrow will change from descending/ascending but none of the actual folders get sorted.
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 17:05
by highend
And after setting the secondary sort order you've clicked on the date column to sort them by date?
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 17:30
by renamerbrian
highend wrote: ↑14 Oct 2022 17:05
And after setting the secondary sort order you've clicked on the date column to sort them by date?
Yes. so I open the program, click the Name column. All of the folders are ordered by A-Z correctly. I then hold the Shift key and click Date Created. A downward facing arrow appears now for that column as well.
so I am now showing an upward arrow for Names and a downward arrow for Date Created. The folders do not get re-sorted by Date Created or in any way.
I hope I am explaining this right....I'm losing hope.
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 17:47
by highend
Click on the date column header again...
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 18:16
by renamerbrian
ok going back to your script. I think I will have to do it by that method. I have attached two files. The first is a list of folder names I'm trying it on. I changed "bank" to HGV in your original script. When I run your script the lines of text in the script pop up in the program window. I don't see it making another column.
I can just create scripts for the main folder names I need to run this for.
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 19:00
by highend
No clue what you're showing there...
"When you run the script".
How do you run that?
It's meant to create a fully configured custom column. And that happens when you "import" it via the snippets; from the address bar...
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 19:16
by renamerbrian
highend wrote: ↑14 Oct 2022 19:00
No clue what you're showing there...
"When you run the script".
How do you run that?
It's meant to create a fully configured custom column. And that happens when you "import" it via the
snippets; from the address bar...
Correct. I input
snippet; from the address bar. It comes up with a window "Stepping through a script", I hit Continue, paste your script and hit OK. It goes back to the main program and there is no additional column.
With the screenshot example I provided with my folder names, should I be able to replace "bank" with HGV from your original script?
I have tried multiple ways. After pasting and clicking OK with your script the window simply closes and I dont see any additional column.
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 20:08
by highend
Disable Menu - Scripting - Step Mode
Do it again...
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 20:21
by renamerbrian
highend wrote: ↑14 Oct 2022 20:08
Disable Menu - Scripting - Step Mode
Do it again...
I disabled Step mode, did snippet; pasted script (with HGV instead of bank), hit OK. Goes back to main screen and no added Column (I promise I'm doing it step by step)
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 14 Oct 2022 20:50
by highend
You are
NOT using
snippet; you're trying to execute a normal script.
Animation.gif
Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?
Posted: 21 Aug 2026 05:09
by python80
Hi,
Is it possible to create a scripted custom column in XYplorer that displays and sorts by the earlier date between 'Date Created' and 'Date Modified'?
Specifically, for each item, the custom column should compare its creation date/time with its modified date/time, and then display whichever one is older (earlier in time).
Thanks in advance!