Can I sort by Date Created first and then have the folder names in Alphabetical order?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
renamerbrian
Posts: 7
Joined: 14 Oct 2022 16:17

Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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.

highend
Posts: 15005
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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...
One of my scripts helped you out? Please donate via Paypal

renamerbrian
Posts: 7
Joined: 14 Oct 2022 16:17

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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!

highend
Posts: 15005
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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...
One of my scripts helped you out? Please donate via Paypal

renamerbrian
Posts: 7
Joined: 14 Oct 2022 16:17

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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.

highend
Posts: 15005
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post by highend »

And after setting the secondary sort order you've clicked on the date column to sort them by date?
One of my scripts helped you out? Please donate via Paypal

renamerbrian
Posts: 7
Joined: 14 Oct 2022 16:17

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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.

highend
Posts: 15005
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post by highend »

Click on the date column header again...
One of my scripts helped you out? Please donate via Paypal

renamerbrian
Posts: 7
Joined: 14 Oct 2022 16:17

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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.
To see the attached files, you need to log into the forum.

highend
Posts: 15005
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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...
One of my scripts helped you out? Please donate via Paypal

renamerbrian
Posts: 7
Joined: 14 Oct 2022 16:17

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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.

highend
Posts: 15005
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post by highend »

Disable Menu - Scripting - Step Mode

Do it again...
One of my scripts helped you out? Please donate via Paypal

renamerbrian
Posts: 7
Joined: 14 Oct 2022 16:17

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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)
To see the attached files, you need to log into the forum.

highend
Posts: 15005
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post by highend »

You are NOT using snippet; you're trying to execute a normal script.
Animation.gif
To see the attached files, you need to log into the forum.
One of my scripts helped you out? Please donate via Paypal

python80
Posts: 17
Joined: 08 Jul 2022 05:49
Location: Windows 10 Pro 22H2 win64 @100%

Re: Can I sort by Date Created first and then have the folder names in Alphabetical order?

Post 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!

Post Reply