FORMATLIST with filter "!*.*"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
bauxite69
Posts: 7
Joined: 07 May 2014 01:11

FORMATLIST with filter "!*.*"

Post by bauxite69 »

Hi,

If a folder name contains .(DOT) FORMATLIST with filter "!*.*" won't return filename without extension

This is working :

Code: Select all

text formatlist("D:\test\data1\filename1|D:\test\data1\filename2.ext", "f", "|", "!*.*")
Return "D:\test\data1\filename1" :biggrin:

This don't :

Code: Select all

text formatlist("D:\test\data.1\filename1|D:\test\data.1\filename2.ext", "f", "|", "!*.*")
Return "" :eh:

The only way i found to achieve that without FORMATLIST is :

Code: Select all

 $list = "";
 foreach($item, "D:\test\data.1\filename1|D:\test\data.1\filename2.ext|D:\test\data.1\filename3.ext", "|") {
         if getpathcomponent($item, "ext") == "" {
            $list = $list . $item . "|";
         }
 }
 $list = trim($list, "|", "r");
 text $list;
Return "D:\test\data1\filename1"

Is there any other way to only get file without extension in a script ?

Thank you

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

Re: FORMATLIST with filter "!*.*"

Post by admin »

What is your main purpose? List all files without extension in a certain folder?

bauxite69
Posts: 7
Joined: 07 May 2014 01:11

Re: FORMATLIST with filter "!*.*"

Post by bauxite69 »

admin wrote:What is your main purpose? List all files without extension in a certain folder?
I have a collection(+1,250,000) of sound modules(+500 filetype) on my external hard drive.
I would like to sort or seek them by filetype.

If i use "Branch View" it takes time, so i decided to build(with FOLDERREPORT) a "file.txt" that contains all sound modules full path.
And then i made a script to search in this "file.txt" with FORMATLIST. It's a lot faster !
Good thing, i can search "file.txt" even if my external hard drive is unplugged !

Only problem is, FORMATLIST can't find files without extension if folder name contains DOT

Thanks

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

Re: FORMATLIST with filter "!*.*"

Post by admin »

I see.

I will add another flag to make to this happen. Looks useful enough to me.

In the next beta you simply do this (watch the last "f" parameter for files):

Code: Select all

text formatlist("D:\test\data.1\filename1|D:\test\data.1\filename2.ext", "f", "|", "!*.*", "f");

bauxite69
Posts: 7
Joined: 07 May 2014 01:11

Re: FORMATLIST with filter "!*.*"

Post by bauxite69 »

admin wrote:I see.

I will add another flag to make to this happen. Looks useful enough to me.

In the next beta you simply do this (watch the last "f" parameter for files):

Code: Select all

text formatlist("D:\test\data.1\filename1|D:\test\data.1\filename2.ext", "f", "|", "!*.*", "f");
Wow, THAT is support !

Thanks a lot :biggrin:

Post Reply