Directory sorting

Features wanted...
MrYang
Posts: 23
Joined: 07 Feb 2019 11:50

Directory sorting

Post by MrYang »

Is there such a function?

Similar to Destop.ini, for example, there is an XYplorer.ini in the directory that stores the order of folders/files.

For example, there are six files in the directory:
A.txt
B.txt
C.txt
D.txt
E.txt
F.txt

The contents saved in XYplorer.ini are:
D.txt
C.txt

Then the order of directories is:
D.txt
C.txt
A.txt
B.txt
E.txt
F.txt

We can create an XYplorer. ini under any directory, and we can edit XYplorer. ini freely.

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Directory sorting

Post by jupe »

Yes you could script this, lookup the scripting command sortbylist (I made a quick example below).

Code: Select all

  sortbylist(readfile("sortorder.ini"));
Also a similar feature FYI:
https://www.xyplorer.com/release_14.30.php#PCSO
https://www.xyplorer.com/release_16.60.php#PCSO

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

Re: Directory sorting

Post by highend »

And please don't name these files "XYplorer.ini"^^
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Directory sorting

Post by admin »

In the meantime I updated the screenshots in release_16.60.php. They are still blank release_14.30.php. (Some criminal lawyers from Hamburg had sued me for using some photos in the thumbs shown in the screenshots... :blackstorm: )

MrYang
Posts: 23
Joined: 07 Feb 2019 11:50

Re: Directory sorting

Post by MrYang »

Thanks very much.

If I use scripts, can the XYplorer execute the specified scripts automatically after I click on a folder?

Every time a folder is opened, the specified script is executed manually, which is inconvenient.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Directory sorting

Post by admin »

How many folders do you have that need a custom sort order?

MrYang
Posts: 23
Joined: 07 Feb 2019 11:50

Re: Directory sorting

Post by MrYang »

In work, many folders need to be categorized. (Classify folders. It's not just files..)

Besides, my stronger need is:
When I browse the Internet, I will screen-capture good articles and materials, there will be more than a dozen or dozens of files in the folder, I hope to sort by category.

I also have a strong need:
There can be some horizontal splitting in the file list. Just like in the menu, it's easy to add a dividing line, which is to use "-".
snap_screen_20191001192531.png
snap_screen_20191001192531.png (26.28 KiB) Viewed 1475 times

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Directory sorting

Post by admin »

If that's a strong need you should probably look somewhere else. XYplorer won't have this kind grouping too soon.

MrYang
Posts: 23
Joined: 07 Feb 2019 11:50

Re: Directory sorting

Post by MrYang »

1. This function was implemented half a year ago, but it is not perfect.
Half a year ago, in order to achieve the custom sorting of folders and add dividing lines, I wrote a script of about 4KB, which was implemented with PaperFolder.
I placed a file in the folder that needed sorting, such as "SortOrder.txt", and I right-clicked in the margin of the list, clicked on the first item, and the folder was sorted.
snap_screen_20191002091618.png
snap_screen_20191002091618.png (36.02 KiB) Viewed 1428 times
But I don't think it's perfect enough.


2. "Manual Sorting" seems to be a problem
For example, there are three folders:

Code: Select all

111
222
333
Step 1: Download the software
Step 2: Set Tools|Customize List|Manual Sorting
Step 3: Move folder 222 to front of folder 111
Step 4: Open folder 111, then click the "Up" button to return to the previous directory.

Now folder 111 is in front of folder 222.
In fact, this is a very good function, and maybe many users will give up this function just like me.


3. It is not difficult to realize this function.
As we all know, in Explorer, there is "Desktop.ini" to achieve personalized functions, such as changing the folder icon.
XYplorer can also have "SortOrder.ini".
For example, the content in "SortOrder.ini" is as follows:

Code: Select all

222
-        // Use '-' to increase the dividing line
111
333
Each time a folder is opened, XYplorer determines whether there is a "SortOrder.ini" file under the folder, and if so, execute the script "sortbylist".
snap_screen_20191002092016.png
snap_screen_20191002092016.png (14.61 KiB) Viewed 1428 times



1、这个功能半年前实现了,只是不完美
半年前,为了实现文件夹的自定义排序,以及增加分割线,我写了大概4KB的脚本,用PaperFolder实现了。
我在需要排序的文件夹中放了一个文件,例如“SortOrder.txt”,我在列表的空白处点击右键,点击第一项,文件夹就排序好了。
只是我觉得这样还不够完美。

2、“Manual Sorting”好像有点问题
例如,有3个文件夹:

Code: Select all

111
222
333
第1步:下载软件
第2步:设置Tools|Customize List|Manual Sorting
第3步:移动文件夹222到文件夹111的前面
第4步:打开文件夹111,然后点击“Up”按钮返回上一级目录。
现在文件夹111在文件夹222的前面。
其实这是一个非常棒的功能,可能很多使用者会跟我一样放弃了这个功能。

3、实现这个功能不难
众所周知,在Explorer中有“Desktop.ini”,实现个性化的功能,比如更改文件夹的图标。
XYplorer也可以有“SortOrder.ini”。
例如“SortOrder.ini”中的内容是这样的:

Code: Select all

222
-        // 用“-”来增加分割线
111
333
每次打开文件夹的时候,XYplorer判断该文件夹下是否有“SortOrder.ini”文件,如果有的话,执行脚本“sortbylist”即可。

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Directory sorting

Post by admin »

Manual Sorting is stored per tab, not per folder.

MrYang
Posts: 23
Joined: 07 Feb 2019 11:50

Re: Directory sorting

Post by MrYang »

admin wrote: 02 Oct 2019 08:00 Manual Sorting is stored per tab, not per folder.
Could you explain it, please? I really don't understand.



"Since v16.60 there is Permanent Custom Sort Order (PCSO): The custom sort order is remembered per tab, across tab switches, and across sessions, and on an explicit List Refresh."

I read the help document, but I still don't understand it.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Directory sorting

Post by admin »


MrYang
Posts: 23
Joined: 07 Feb 2019 11:50

Re: Directory sorting

Post by MrYang »

My understanding is as follows:

There is a tab A showing three folders:

Code: Select all

111
222
333
Step 1: Set Tools|Customize List|Manual Sorting
Step 2: Move folder 222 to the front of folder 111.
Step 3: Now switch to tab B.
Step 4: Switch to tab A.

Now folder 222 is in front of folder 111.

Step 5: Open folder 111, then click the "Up" button to return to the previous directory.

Now folder 111 is in front of folder 222.

But.
This is only a little useful. It's not very useful.

When I was looking for a job 10 years ago, I contacted my HR. There were many folders under one of her folders. This method was used to sort folders.

Code: Select all

01-CCC
02-AAA
11-HHH
12-DDD
If one day, she needs to adjust the order of folders, rename folder 12-DDD to 03-DDD, then some shortcuts(*.lnk) may fail. (The previously saved shortcuts will fail, and clicking on the shortcuts will not find the path.) But in fact, folder names are all DDD, adding some numbers just for sorting.

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Directory sorting

Post by jupe »

in my opinion for what you are trying to achieve you would be better using an Extra "soft column", and tagging each file with an index number, then you will have a column to sort by that will be permanent, and won't require an external file in each folder, won't require renaming files, and can be remembered on location or tab changes, and even permanently saved as the default sorting method via FVS

https://www.xyplorer.com/release_13.80.php#ExtraTags

MrYang
Posts: 23
Joined: 07 Feb 2019 11:50

Re: Directory sorting

Post by MrYang »

Before adjusting the order:

Code: Select all

AAA  (Marked as: 1)
BBB  (Marked as: 2)
CCC  (Marked as: 3)
DDD  (Marked as: 4)
EEE  (Marked as: 5)
After adjusting the order:

Code: Select all

AAA  (Marked as: 1)
EEE  (Marked as: 2)
BBB  (Marked as: 3)
CCC  (Marked as: 4)
DDD  (Marked as: 5)
According to your method, folder EEE, folder BBB, folder CCC and folder DDD need to be re marked.
It takes a lot of time if there are more than ten folders that need to be re marked.
Last edited by MrYang on 02 Oct 2019 10:32, edited 1 time in total.

Post Reply