Add Date & Time in txt-file

Discuss RoboTask here
Post Reply
Agda Drift
Posts: 11
Joined: Tue Apr 01, 2008 4:18 am

Add Date & Time in txt-file

Post by Agda Drift »

Is it possible to add date and time in the textfile before the the text you define in the task "Write to text file". I want to create i simple logfile from the task.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Add Date & Time in txt-file

Post by Oleg »

Yes, of course. Just insert {DateTime} string before your text line.
You can find more variables here: menu Options -> Variables

Also see a simple example below:

;*****************************
;* RoboTask Task file       
;* Do not edit in text editor!
;*****************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|700197831
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task613"
Hide=INTEGER|0
ID=INTEGER|1197903318
Name=STRING|"Simple Log File"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER

[Actions\Action1]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file c:\simpleLog.txt"
Params=FOLDER

[Actions\Action1\Params]
fileexists=STRING|"1"
filname=STRING|"c:\simpleLog.txt"
line0=STRING|"{DateTime}; My text "
linecount=STRING|"1"
Post Reply