Page 1 of 1

Some help on renaming files

Posted: Tue Nov 30, 2004 12:48 pm
by Dr.Zer0
Hello everybody,
I'm testing this software for a simple application on our company shop floor, we are collecting pictures from an industrial vision system and the limition of this system is that it will generate file name in progression from 0 to 999 and then start again, of course it will overwrite all my pre existing files, I wonder how can I rename files in the folder in sequence 0 to whatever and thenn move its content every five minute so I will always have a new et of files? I've tryed to check in the variable but I could not find anything to create a counter for my file name, is anybody willing to point me in the right direction. thanks again for your help.
Best regards,
Fabio C.

Some help on renaming files

Posted: Fri Dec 03, 2004 4:39 am
by Oleg
See task below. This task do the following:
1. Create a folder. The folder name based on current date and time.
2. Move files from folder c:\source to created folder.

Task have a triggering event Cyclic which startes this task every 5 min.
Therefore you have accumulative archive of pictures. After importing this task don't forget set enabled switch to ON

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

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|565106205
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task210"
Hide=INTEGER|0
ID=INTEGER|295352623
Name=STRING|"Backup vision"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""FOLDERNAME"" with value ""c:\dest\{Year}{MonthNo}{Day}{Hours}{Minutes}"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"1"
varname=STRING|"FOLDERNAME"
varvalue=STRING|"c:\dest\{Year}{MonthNo}{Day}{Hours}{Minutes }"

[Actions\Action2]
ActionID=STRING|"A_FOLDER_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create Folder ({FolderName})"
Params=FOLDER

[Actions\Action2\Params]
newfolder=STRING|"{FolderName}"

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

[Actions\Action3\Params]
destdir=STRING|"{FolderName}"
f_count=STRING|"1"
file0=STRING|"c:\Source\*.*"
ifexists=STRING|"1"
move=STRING|"1"
subdir=STRING|"0"

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

[Actions\Action4\Params]
varname=STRING|"FOLDERNAME"

[Events]
Event1=FOLDER

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

[Events\Event1\Params]
id=STRING|"DJ33L7HL"
interval=STRING|"300"