Page 1 of 1

FORMATLIST with filter "!*.*"

Posted: 07 May 2014 11:48
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

Re: FORMATLIST with filter "!*.*"

Posted: 07 May 2014 15:29
by admin
What is your main purpose? List all files without extension in a certain folder?

Re: FORMATLIST with filter "!*.*"

Posted: 07 May 2014 17:46
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

Re: FORMATLIST with filter "!*.*"

Posted: 07 May 2014 18:52
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");

Re: FORMATLIST with filter "!*.*"

Posted: 07 May 2014 19:28
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: