Add characters to existing filename

Discuss RoboTask here
Post Reply
Prem
Posts: 35
Joined: Fri Sep 30, 2005 2:01 am
Location: Netherlands

Add characters to existing filename

Post by Prem »

I dont know how to rename a file by adding characters to the existing filename, for example "FAX-" in front of it. When I make the renaming action FAX-*.* (or FAX?.* works the same), the first four characters of the falename are replaced with FAX-, instead of adding the FAX- in front of the filename.
Any suggestions? Thanks
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Add characters to existing filename

Post by Oleg »

Try the example below. This task add prefix FAX- to all files in folder c:\temp, and next moves files with mask FAX-*.* to c:\incoming folder.
Save the text of task to file and use menu Task|Import to import into RoboTask.
By the way: you can find more examples here

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

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|565106205
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task310"
Hide=INTEGER|0
ID=INTEGER|163933500
Name=STRING|"Add Prefix to Filename"
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_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20051001"
date2=STRING|"20051001"
destvar=STRING|"TEMP_FILE_NAME"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"C:\Temp\*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_FILE_RENAME"
Enabled=INTEGER|-1
Name=STRING|"Rename File"
Params=FOLDER

[Actions\Action2\Params]
count=STRING|"1"
file0=STRING|"{temp_file_name}"
mask=STRING|"FAX-{ExtractFileName({temp_file_name})}"
subdirs=STRING|"0"

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

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

[Actions\Action4\Params]
destdir=STRING|"c:\incoming"
f_count=STRING|"1"
file0=STRING|"C:\Temp\fax-*.*"
ifexists=STRING|"1"
move=STRING|"1"
subdir=STRING|"0"
Prem
Posts: 35
Joined: Fri Sep 30, 2005 2:01 am
Location: Netherlands

Add characters to existing filename

Post by Prem »

Thank you very much, Oleg
Post Reply