filter files ending in 'L'

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: filter files ending in 'L'

Post by kotlmg »

if it is possible please give the code sir.

jaywalker32
Posts: 205
Joined: 27 May 2014 05:24

Re: filter files ending in 'L'

Post by jaywalker32 »

Run this in the folder:

Code: Select all

	$list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	foreach($i,$list,""){
		$results = replace(quicksearch(">($i)\.[^.]+$ /nc"), <crlf>, "|");
		if($results){
			if(exists($i) != 2){
				new($i,"dir")
			}			
			moveto($i, $results);
		}
	}

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: filter files ending in 'L'

Post by highend »

A bit more streamlined...

Code: Select all

    $letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    foreach($letter, $letters, "") {
        $files = quicksearch(">$letter\.[^.]+$ /nc", , "|");
        if ($files) { moveto $letter, $files, , 2, 2; }
    }
One of my scripts helped you out? Please donate via Paypal

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: filter files ending in 'L'

Post by kotlmg »

i am getting the error "unable to access file 1H.wav, 2H.wav etc"

and wrong files are going to wrong letter folders.

jaywalker32
Posts: 205
Joined: 27 May 2014 05:24

Re: filter files ending in 'L'

Post by jaywalker32 »

Check if those files are open in your media player or some other application. Try exiting any application that you may have used those files in previously.

Give an example of a filename that was moved to a wrong folder.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: filter files ending in 'L'

Post by kotlmg »

no player is running.
the following files gone to E folder.
24H.WAV
25H.WAV
26H.WAV
27H.WAV
28H.WAV
29H.WAV
30H.WAV
31H.WAV
and 01L.WAV, O2L.WAV ... 1000L.WAV are not accessible.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: filter files ending in 'L'

Post by highend »

Can't reproduce...
2019-11-19_180845.png
2019-11-19_180845.png (5.09 KiB) Viewed 1039 times
One of my scripts helped you out? Please donate via Paypal

Post Reply