Topic: Rename Folder Based on Content
Renaming files based on folder names is easy using %p and its variants.
Renaming folders based on the files in the folder is quite difficult.
ie:
pictures\1\bob01.jpg -> pictures\Bob\bob01.jpg
pictures\2\mary01.jpg -> pictures\Mary\mary01.jpg
pictures\3\sam01.jpg -> pictures\Sam\sam01.jpg
A variable that reported directory contents would be very useful here.
Something like %k{line,path,param,ext}
Where:
Line=Line # from dir command output (ie 1,2,-1,-2,etc) Default=1
Path=standard path specification Default=path of current selection
Param=standard DIR command parameters Default=/A:-d-h-s /B /On
Ext=File Extension On/Off Switch Default=OFF (ie. strip file extension from line)
Once the string was returned it would be fairly easy using standard operations to rename according to preference.
Using the above example with folders 1,2,3 etc selected
%Uk(s/([a-z]+)\d.*/\1/i) would give the result shown, as would %Uk(1,-2), etc.
Line = 0 could return entire dir command output for parsing by regex.