To Oleg: Selecting Groups of Files

Discuss RoboTask here
Post Reply
Red_Eye
Posts: 1
Joined: Sun Nov 28, 2004 11:33 am

To Oleg: Selecting Groups of Files

Post by Red_Eye »

Hi Oleg, I see you are webmaster here  I am new to this software and would like some help to see if Robotask can do the following:
I have a folder called "MP3Files" with about 1000 mp3 files in it on my C: drive. I want to move the first 10 files from the folder into a new folder called "CD1". Then, as part of the same task, move the next 10 files into a new folder called "CD2". This will continue until the "MP3Files" folder is empty.
The folders called "CD1", "CD2" ... "CD500" etc already exist on my C: drive. The precise number of files in the "MP3Files" folder will vary from time to time.
I do not know how to implement this into a task though. Is it a loop? Could you please write it here and I will modify it and import it to Robotask?
Thank you for your help and a good program.
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

To Oleg: Selecting Groups of Files

Post by Oleg »

Excuse me for long silence. It's not difficult. You may use the File loop and two variables for numeration.
See rask below. This task can create folders CD1..CDN if needed.

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|565106205
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task92"
Hide=INTEGER|0
ID=INTEGER|1065926379
Name=STRING|"Selecting Groups of Files"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""FOLDERNUM"" with value ""0"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"FOLDERNUM"
varvalue=STRING|"0"

[Actions\Action10]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action11]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action12]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""FOLDERNUM"""
Params=FOLDER

[Actions\Action12\Params]
varname=STRING|"FOLDERNUM"

[Actions\Action13]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""NUMFILE"""
Params=FOLDER

[Actions\Action13\Params]
varname=STRING|"NUMFILE"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""NUMFILE"" with value ""0"""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varname=STRING|"NUMFILE"
varvalue=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action3\Params]
createmode=STRING|"1"
date1=STRING|"20041203"
date2=STRING|"20041203"
destvar=STRING|"FILENAME"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"C:\MP3Files\*.mp3"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_FOLDER_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create Folder (c:\cd{FolderNum})"
Params=FOLDER

[Actions\Action4\Params]
newfolder=STRING|"c:\cd{FolderNum}"

[Actions\Action5]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action5\Params]
destdir=STRING|"c:\cd{FolderNum}"
f_count=STRING|"1"
file0=STRING|"{FileName}"
ifexists=STRING|"0"
move=STRING|"1"
subdir=STRING|"0"

[Actions\Action6]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""NumFile"""
Params=FOLDER

[Actions\Action6\Params]
incement=STRING|"1"
vaiable=STRING|"NumFile"

[Actions\Action7]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action7\Params]
case=STRING|"0"
operator=STRING|"2"
type=STRING|"1"
value1=STRING|"{NumFile}"
value2=STRING|"10"

[Actions\Action8]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""FolderNum"""
Params=FOLDER

[Actions\Action8\Params]
incement=STRING|"1"
vaiable=STRING|"FolderNum"

[Actions\Action9]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""NUMFILE"" with value ""0"""
Params=FOLDER

[Actions\Action9\Params]
expand=STRING|"0"
varname=STRING|"NUMFILE"
varvalue=STRING|"0"

;end of task
Post Reply