Can this be done?

Discuss RoboTask here
Post Reply
klunde
Posts: 2
Joined: Fri Sep 28, 2007 3:37 am
Location: Norway

Can this be done?

Post by klunde »

I'm in the need of a program that does the following:1) Monitors a given folder for files of a given extension (.icd)2) When a new .icd file is found it should zip some other files with the same filename (but different extension) in the same directory to a new zip file with the same name as the .icd file that was found (zip extension).3) Upload the newly created zip file to an ftp server4) create a new file with the same filename and extension .4faCan Robotask do this?
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Can this be done?

Post by Oleg »

Yes, of course RoboTask can do this.

See the scenario below. Your task will be like this example.
The example monitores the c:\incoming folder and does all needed operations. File name has been extracted by {ExtractFileNameNoExt()} system variable. In order to learn more about variables, go to Options -> Variables.

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

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1947094105
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task524"
Hide=INTEGER|0
ID=INTEGER|1404299967
Name=STRING|"Monitore files, pack and other operations"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER

[Actions\Action1]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action1\Params]
destvar=STRING|"CURRENT_ICD"
file=STRING|"c:\new_icd.txt"
linecount=STRING|"0"
sourcetext=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""C_FILENAME_ONLY"" with value ""{ExtractFileNameNoExt({Current_ICD})}"""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"1"
varname=STRING|"C_FILENAME_ONLY"
varvalue=STRING|"{ExtractFileNameNoExt({Current_ICD})}"

[Actions\Action3]
ActionID=STRING|"A_ZIP_PACK"
Enabled=INTEGER|-1
Name=STRING|"Pack Files"
Params=FOLDER

[Actions\Action3\Params]
action=STRING|"0"
coment0=STRING|"{DateTime}, {DayOfWeek}"
coment1=STRING|"This zip-archive created by RoboTask (C) 2003 Neowise"
comentcount=STRING|"2"
compreslevel=STRING|"1"
destfile=STRING|"c:\incoming\{c_filename_only}.zip"
dosformat=STRING|"0"
exclude=STRING|"*.icd"
file0=STRING|"c:\incoming\{c_filename_only}.*"
filecount=STRING|"1"
includesubfolders=STRING|"1"
incsysandhidden=STRING|"0"
junkdirnames=STRING|"0"
password=STRING|"2488924689257142493915059"

[Actions\Action4]
ActionID=STRING|"A_FTP_LOGON"
Enabled=INTEGER|-1
Name=STRING|"FTP Log On"
Params=FOLDER

[Actions\Action4\Params]
anonymous=STRING|"1"
host=STRING|"localhost"
passive=STRING|"0"
password=STRING|"4231738316406194034628830408604112640602242 423831112461"
port=STRING|"21"
username=STRING|"anonymous"

[Actions\Action5]
ActionID=STRING|"A_FTP_UPLOAD"
Enabled=INTEGER|-1
Name=STRING|"FTP Upload"
Params=FOLDER

[Actions\Action5\Params]
file=STRING|"c:\incoming\{c_filename_only}.zip"
folder=STRING|"/incoming"

[Actions\Action6]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file c:\incoming\{c_filename_only}.4fa"
Params=FOLDER

[Actions\Action6\Params]
fileexists=STRING|"0"
filname=STRING|"c:\incoming\{c_filename_only}.4fa"
line0=STRING|"The task has been finished at {DateTime}!"
linecount=STRING|"1"

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

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER

[Events\Event1\Params]
chg=STRING|"0"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"C:\incoming"
foldercount=STRING|"1"
id=STRING|"ALN07EIO1"
incmask=STRING|"*.icd"
interval=STRING|"60"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
onelist=STRING|"c:\new_icd.txt"
saveresults=STRING|"1"
subfolders1=STRING|"0"
klunde
Posts: 2
Joined: Fri Sep 28, 2007 3:37 am
Location: Norway

Can this be done?

Post by klunde »

Thanks!I've been testing a little here as well and one qustion: Why have you  in your example used a text loop while I have now done the same (I think) with a file loop - whats the difference?
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Can this be done?

Post by Oleg »

Of course you can do this with a file loop on *.icd files. If you move (or rename) original file then both variants give you the same result.
Post Reply