Page 1 of 2

filter files ending in 'L'

Posted: 13 Nov 2019 14:55
by kotlmg
hello sir,
how to filter files ending in letter 'L' and send them to 'L' folder?

with regards,
kotlmg

Re: filter files ending in 'L'

Posted: 16 Nov 2019 09:20
by jaywalker32

Code: Select all

moveto("L", quicksearch(">(L)\.[^.]+$ /nc");
This should work.

The \.[^.]+$ will match any extension.

/n switch the restrict search to exclude subfolders
/c switch will make it case-sensitive

Run this first to make sure you're selecting the correct files:

Code: Select all

text quicksearch(">(L)\.[^.]+$ /nc");

Re: filter files ending in 'L'

Posted: 17 Nov 2019 18:35
by kotlmg
thanks for your script.
moveto("L", quicksearch(">(L)\.[^.]+$ /nc");
with above script, i am getting the error, the destination you have selected doen't exist. couldn't create new path. the file operation will not happen.

Re: filter files ending in 'L'

Posted: 17 Nov 2019 18:42
by highend
And in which directory are you, when you execute the command?

Btw, the command isn't syntactically correct. It's missing an ending
")" but even more so, it shouldn't use them at all. It's not a function,
it doesn't has a return value.

Code: Select all

moveto "L", quicksearch(">(L)\.[^.]+$ /nc");

Re: filter files ending in 'L'

Posted: 17 Nov 2019 18:56
by kotlmg
i am in folder D:\Partronics eboards Pvt.Ltd\IPIS\Wav Files\Digits - Copy\.

i am getting the error "the following items does not exist."
it is giving script error.

Re: filter files ending in 'L'

Posted: 17 Nov 2019 19:50
by highend
Screenshot of that error. If that folder really has write access it shouldn't fail to create a subfolder

Re: filter files ending in 'L'

Posted: 18 Nov 2019 17:22
by kotlmg
screenshots attached herewith.

Re: filter files ending in 'L'

Posted: 18 Nov 2019 17:33
by highend
Use the correct script call from viewtopic.php?p=174303#p174303
...

Re: filter files ending in 'L'

Posted: 18 Nov 2019 18:31
by kotlmg
it is not working

Re: filter files ending in 'L'

Posted: 18 Nov 2019 18:40
by highend
Ok. Show the belonging screen shots of the error message you're getting after using
the command I posted above...

Re: filter files ending in 'L'

Posted: 18 Nov 2019 18:46
by kotlmg
error messages enclosed herewith.

Re: filter files ending in 'L'

Posted: 18 Nov 2019 18:52
by highend
Then either use this:
moveto "L", replace(quicksearch(">(L)\.[^.]+$ /nc"), <crlf>, "|");

or update to at least v20.50.0201

Re: filter files ending in 'L'

Posted: 18 Nov 2019 18:57
by kotlmg
the above script worked perfectly.
thanks a lot.

Re: filter files ending in 'L'

Posted: 19 Nov 2019 04:57
by kotlmg
moveto "L", replace(quicksearch(">(L)\.[^.]+$ /nc"), <crlf>, "|");

hello sir,
how to extend the above script to files ending in 'A'/'B'/'C'/..'Z'
A should go to A folder.
B should go to B folder.
..
Z should go to Z folder.

with regards,
kotlmg

Re: filter files ending in 'L'

Posted: 19 Nov 2019 08:45
by highend
Not possible with a single line. Use a while loop and iterate over all chars from A-Z,
find the files that match that ending char with regexmatches and execute the
moveto for these "blocks of files"