mIRC Home    About    Download    Register    News    Help

Print Thread
#155073 03/08/06 02:37 PM
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
hello all,

okay to start off, i'm gonna say i don't have a clue about doing this... now, i've seen a couple of examples on moving files from one folder to another... but my question is.. would there be a way to check the name of the file(s) being moved and make a dir from the file name like emaple: if the file name is hi.how.you.txt : would there be a way to have it make a dir hi how are you then move the file in it? if so coupl someone be kind enough to help with this... or at least let me know what i should be looking for in the help file to try and figure this out..

as of right now i have no code to show..... but would appreciate any helpfull info..

thanks in advance

#155074 03/08/06 10:09 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Assuming %filename has the name of the file in it, example hi.how.you.txt
Assuming %filefolder has the foldername of the file in it, example c:\text files
Assuming %destrootfolder has the foldername of the root folder for the folders your gonna create, example c:\test files\sorted

Code:
var %makefolder = $replace($deltok(%filename,-1,46),.,$chr(32))
mkdir $+(",%destrootfolder,\,%makefolder,")
if ($isdir($+(%destrootfolder,\,%makefolder))) { rename $+(",%filefolder,\,%filename,") $+(",%destrootfolder,\,%makefolder,\,%filename,") }


* i could have done that more compactly but i wanted u to see the components as clearly as i could.


Link Copied to Clipboard