Hi,
I have a task that is looping through several RoboFtp log files to extract when files were sent and if they completed or errored. I'm using a series of if/then statements and str pos to find the info then extract to variables.
The variables are declared locally.
My first if/then looks for sending.
If found, extracts the the characters between " " and stores it in a variable{L_FILE_NAME}
The second set of if/then statements look for upload.
If found, extract certain characters and stores it in variable{L_STATUS}
All of the variables are contained in an output statement assigned to L_OUT. {L_OUT} {L_FILE_NAME} {L_STATUS}{EOL}
There may be several instances where sending/upload is found in each file.
The output will contain the first line where sending matched but will not contain the upload (which will usually be on the next line or so depending on how many files sent). The second and subsequent lines will contain all the info needed.
Thoughst?
Variable not setting properly
Variable not setting properly
Last edited by Naras on Thu Apr 11, 2013 12:39 pm, edited 1 time in total.
Re: Variable not setting properly
It would be great to see the full task.
But I think that you forget to turn ON "Expand variable value now" parameter.
See on screenshot:

This is a very frequent mistake.
But I think that you forget to turn ON "Expand variable value now" parameter.
See on screenshot:

This is a very frequent mistake.
Oleg Yershov
Re: Variable not setting properly
Hi Oleg,
Thanks for your help. That doesn't appear to be the issue. I've attached the task.
Naras
Thanks for your help. That doesn't appear to be the issue. I've attached the task.
Naras
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|389577733
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task438"
Hide=INTEGER|0
ID=INTEGER|1832774599
LocalVariables=STRING|"L_CUR_FILE,L_CHAR_POS,L_MONTH,L_FILE_NAME,L_CUR_LINE,L_OUT,"" L_FILE_NAME"",L_LINE_COUNT,L_TOTAL_LINE_COUNT,L_FOUNDLINE,L_FILE_STATUS,L_FILE_DATE,L_LOG,L_LOG_FILE_NAME,L_LINE_DATE,L_YEAR,L_MONTH,L_DAY,L_NEW_DATE,L_F_CHAR,L_CURR_STATUS,L_DL_STATUS,L_UL_STATUS"
LogOnAsUser=INTEGER|1
Name=STRING|" Scan FTP LOGS "
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action18=FOLDER
Action19=FOLDER
Action2=FOLDER
Action20=FOLDER
Action21=FOLDER
Action22=FOLDER
Action23=FOLDER
Action24=FOLDER
Action25=FOLDER
Action26=FOLDER
Action27=FOLDER
Action28=FOLDER
Action29=FOLDER
Action3=FOLDER
Action30=FOLDER
Action31=FOLDER
Action32=FOLDER
Action33=FOLDER
Action34=FOLDER
Action35=FOLDER
Action36=FOLDER
Action37=FOLDER
Action38=FOLDER
Action39=FOLDER
Action4=FOLDER
Action40=FOLDER
Action41=FOLDER
Action42=FOLDER
Action43=FOLDER
Action44=FOLDER
Action45=FOLDER
Action46=FOLDER
Action47=FOLDER
Action48=FOLDER
Action49=FOLDER
Action5=FOLDER
Action50=FOLDER
Action51=FOLDER
Action52=FOLDER
Action53=FOLDER
Action54=FOLDER
Action55=FOLDER
Action56=FOLDER
Action57=FOLDER
Action58=FOLDER
Action59=FOLDER
Action6=FOLDER
Action60=FOLDER
Action61=FOLDER
Action62=FOLDER
Action63=FOLDER
Action64=FOLDER
Action65=FOLDER
Action66=FOLDER
Action67=FOLDER
Action68=FOLDER
Action69=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*--Process FTP Sending/Receiving Lines include Status: upload/download/error"
Params=FOLDER
[Actions\Action1\Params]
comment=STRING|"*--Process FTP Sending/Receiving Lines include Status: upload/download/error"
[Actions\Action10]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop -through Log File"
Params=FOLDER
[Actions\Action10\Params]
destvar=STRING|"L_CUR_LINE"
file=STRING|"C:\RoboFTP LOG files\{L_LOG_FILE_NAME}"
linecount=STRING|"0"
sourcetext=STRING|"0"
[Actions\Action11]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""L_TOTAL_LINE_COUNT"""
Params=FOLDER
[Actions\Action11\Params]
incement=STRING|"1"
vaiable=STRING|"L_TOTAL_LINE_COUNT"
[Actions\Action12]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_LOGID"" with value ""{ExtractFileName({L_CUR_FILE})}"""
Params=FOLDER
[Actions\Action12\Params]
expand=STRING|"1"
varname=STRING|"L_LOGID"
varvalue=STRING|"{ExtractFileName({L_CUR_FILE})}"
[Actions\Action13]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract first 2 chars from current file name assign to L_F_CHAR"
Params=FOLDER
[Actions\Action13\Params]
amount=STRING|"2"
from=STRING|"1"
source=STRING|"{ExtractFileName({L_CUR_FILE})}"
variable=STRING|"L_F_CHAR"
[Actions\Action14]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_FOUNDLINE"" with value ""F"""
Params=FOLDER
[Actions\Action14\Params]
expand=STRING|"1"
varname=STRING|"L_FOUNDLINE"
varvalue=STRING|"F"
[Actions\Action15]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_CURR_STATUS"" with value """""
Params=FOLDER
[Actions\Action15\Params]
expand=STRING|"1"
varname=STRING|"L_CURR_STATUS"
[Actions\Action16]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*---Process the Date--"
Params=FOLDER
[Actions\Action16\Params]
comment=STRING|"*---Process the Date--"
[Actions\Action17]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract - Year"
Params=FOLDER
[Actions\Action17\Params]
amount=STRING|"5"
from=STRING|"1"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_YEAR"
[Actions\Action18]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract - Month"
Params=FOLDER
[Actions\Action18\Params]
amount=STRING|"2"
from=STRING|"7"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_MONTH"
[Actions\Action19]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract - Day"
Params=FOLDER
[Actions\Action19\Params]
amount=STRING|"2"
from=STRING|"10"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_DAY"
[Actions\Action2]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action2\Params]
message=STRING|"LOGID: {TaskName}"
type=STRING|"3"
[Actions\Action20]
ActionID=STRING|"A_STR_TRIM"
Enabled=INTEGER|-1
Name=STRING|"STR Trim"
Params=FOLDER
[Actions\Action20\Params]
custom=STRING|"1"
customchar=STRING|"["
eol=STRING|"0"
lead=STRING|"1"
source=STRING|"{L_YEAR}"
spaces=STRING|"0"
tabs=STRING|"0"
trailing=STRING|"0"
variable=STRING|"L_YEAR"
[Actions\Action21]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_LINE_DATE"" with value ""{L_YEAR}/{L_MONTH}/{L_DAY}"""
Params=FOLDER
[Actions\Action21\Params]
expand=STRING|"1"
varname=STRING|"L_LINE_DATE"
varvalue=STRING|"{L_YEAR}/{L_MONTH}/{L_DAY}"
[Actions\Action22]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*---See if Date Matches "
Params=FOLDER
[Actions\Action22\Params]
comment=STRING|"*---See if Date Extracted Matches Yesterday"
[Actions\Action23]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then L_NEW_DATE = L_LINE_DATE process lines"
Params=FOLDER
[Actions\Action23\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{L_LINE_DATE}"
value2=STRING|"{L_NEW_DATE}"
[Actions\Action24]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""L_LINE_COUNT"""
Params=FOLDER
[Actions\Action24\Params]
incement=STRING|"1"
vaiable=STRING|"L_LINE_COUNT"
[Actions\Action25]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*---Process lines that contain Receiving, Sending, Upload, Download, File"
Params=FOLDER
[Actions\Action25\Params]
comment=STRING|"*---Process lines that contain Receiving, Sending, Upload, Download, File"
[Actions\Action26]
ActionID=STRING|"A_STR_POS"
Enabled=INTEGER|-1
Name=STRING|"STR Pos sending found assign to L_CHAR_POS"
Params=FOLDER
[Actions\Action26\Params]
case=STRING|"1"
from=STRING|"1"
search=STRING|"Sending"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_CHAR_POS"
[Actions\Action27]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then L_CHAR_POS of Sending"
Params=FOLDER
[Actions\Action27\Params]
case=STRING|"1"
operator=STRING|"3"
type=STRING|"1"
value1=STRING|"{L_CHAR_POS}"
value2=STRING|"0"
[Actions\Action28]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract assign to L_FILE_DATE"
Params=FOLDER
[Actions\Action28\Params]
amount=STRING|"16"
from=STRING|"2"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_FILE_DATE"
[Actions\Action29]
ActionID=STRING|"A_STR_BETWEEN"
Enabled=INTEGER|-1
Name=STRING|"STR Between "" and "" assign to L_FILE_NAME"
Params=FOLDER
[Actions\Action29\Params]
begin=STRING|""""
case=STRING|"0"
end=STRING|""""
save=STRING|"0"
source=STRING|"{L_CUR_LINE}"
startpos=STRING|"1"
variable=STRING|"L_FILE_NAME"
[Actions\Action3]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*--Date is set for Yesterday YYYY/MM/DD"
Params=FOLDER
[Actions\Action3\Params]
comment=STRING|"*--Date is set for Yesterday YYYY/MM/DD"
[Actions\Action30]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_FOUNDLINE"" with value ""T"""
Params=FOLDER
[Actions\Action30\Params]
expand=STRING|"1"
varname=STRING|"L_FOUNDLINE"
varvalue=STRING|"T"
[Actions\Action31]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action32]
ActionID=STRING|"A_STR_POS"
Enabled=INTEGER|-1
Name=STRING|"STR Pos -*Upload"
Params=FOLDER
[Actions\Action32\Params]
case=STRING|"0"
from=STRING|"1"
search=STRING|"*Upload"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_CHAR_POS"
[Actions\Action33]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then *Upload "
Params=FOLDER
[Actions\Action33\Params]
case=STRING|"0"
operator=STRING|"3"
type=STRING|"1"
value1=STRING|"{L_CHAR_POS}"
value2=STRING|"0"
[Actions\Action34]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract L_CUR_LINE assign to L_UL_STATUS"
Params=FOLDER
[Actions\Action34\Params]
amount=STRING|"256"
from=STRING|"37"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_UL_STATUS"
[Actions\Action35]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action36]
ActionID=STRING|"A_STR_POS"
Enabled=INTEGER|-1
Name=STRING|"STR Pos -*File upload error"
Params=FOLDER
[Actions\Action36\Params]
case=STRING|"1"
from=STRING|"1"
search=STRING|"*File upload error"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_CHAR_POS"
[Actions\Action37]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then File Upload Error"
Params=FOLDER
[Actions\Action37\Params]
case=STRING|"0"
operator=STRING|"3"
type=STRING|"1"
value1=STRING|"{L_CHAR_POS}"
value2=STRING|"0"
[Actions\Action38]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract L_CUR_LINE assign to L_UL_STATUS"
Params=FOLDER
[Actions\Action38\Params]
amount=STRING|"256"
from=STRING|"37"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_UL_STATUS"
[Actions\Action39]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action4]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_NEW_DATE"" with value ""{YearIncDays(-1)}/{MonthIncDays(-1)}/{IncDays(-1)}"""
Params=FOLDER
[Actions\Action4\Params]
expand=STRING|"0"
varname=STRING|"L_NEW_DATE"
varvalue=STRING|"{YearIncDays(-1)}/{MonthIncDays(-1)}/{IncDays(-1)}"
[Actions\Action40]
ActionID=STRING|"A_STR_POS"
Enabled=INTEGER|-1
Name=STRING|"STR Pos receiving found assign to L_CHAR_POS"
Params=FOLDER
[Actions\Action40\Params]
case=STRING|"1"
from=STRING|"1"
search=STRING|"Receiving"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_CHAR_POS"
[Actions\Action41]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then L_CHAR_POS of Receiving"
Params=FOLDER
[Actions\Action41\Params]
case=STRING|"1"
operator=STRING|"3"
type=STRING|"1"
value1=STRING|"{L_CHAR_POS}"
value2=STRING|"0"
[Actions\Action42]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract assign to L_FILE_DATE"
Params=FOLDER
[Actions\Action42\Params]
amount=STRING|"16"
from=STRING|"2"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_FILE_DATE"
[Actions\Action43]
ActionID=STRING|"A_STR_BETWEEN"
Enabled=INTEGER|-1
Name=STRING|"STR Between "" and "" assign to L_FILE_NAME"
Params=FOLDER
[Actions\Action43\Params]
begin=STRING|""""
case=STRING|"0"
end=STRING|""""
save=STRING|"0"
source=STRING|"{L_CUR_LINE}"
startpos=STRING|"1"
variable=STRING|"L_FILE_NAME"
[Actions\Action44]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_FOUNDLINE"" with value ""T"""
Params=FOLDER
[Actions\Action44\Params]
expand=STRING|"1"
varname=STRING|"L_FOUNDLINE"
varvalue=STRING|"T"
[Actions\Action45]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action46]
ActionID=STRING|"A_STR_POS"
Enabled=INTEGER|-1
Name=STRING|"STR Pos -*Download "
Params=FOLDER
[Actions\Action46\Params]
case=STRING|"0"
from=STRING|"1"
search=STRING|"*Download"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_CHAR_POS"
[Actions\Action47]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then *Download"
Params=FOLDER
[Actions\Action47\Params]
case=STRING|"0"
operator=STRING|"3"
type=STRING|"1"
value1=STRING|"{L_CHAR_POS}"
value2=STRING|"0"
[Actions\Action48]
ActionID=STRING|"A_STR_EXTRACT"
Enabled=INTEGER|-1
Name=STRING|"STR Extract L_CUR_LINE assign to L_DL_STATUS"
Params=FOLDER
[Actions\Action48\Params]
amount=STRING|"256"
from=STRING|"37"
source=STRING|"{L_CUR_LINE}"
variable=STRING|"L_DL_STATUS"
[Actions\Action49]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action5]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*--Set Date for a specific day within the file loop period: Leave unchecked if using Yesterday as parameter"
Params=FOLDER
[Actions\Action5\Params]
comment=STRING|"*--Set Date for a specific day within the file loop period"
[Actions\Action50]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*---End Process lines in file"
Params=FOLDER
[Actions\Action50\Params]
comment=STRING|"*---End Process lines in file"
[Actions\Action51]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*---Gather Output Info"
Params=FOLDER
[Actions\Action51\Params]
comment=STRING|"*---Gather info and send it to L_OUT"
[Actions\Action52]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then ul"
Params=FOLDER
[Actions\Action52\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{L_F_CHAR}"
value2=STRING|"ul"
[Actions\Action53]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_CURR_STATUS"" with value ""{L_UL_STATUS}"""
Params=FOLDER
[Actions\Action53\Params]
expand=STRING|"1"
varname=STRING|"L_CURR_STATUS"
varvalue=STRING|"{L_UL_STATUS}"
[Actions\Action54]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action55]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then dl"
Params=FOLDER
[Actions\Action55\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{L_F_CHAR}"
value2=STRING|"dl"
[Actions\Action56]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_CURR_STATUS"" with value ""{L_DL_STATUS}"""
Params=FOLDER
[Actions\Action56\Params]
expand=STRING|"1"
varname=STRING|"L_CURR_STATUS"
varvalue=STRING|"{L_DL_STATUS}"
[Actions\Action57]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action58]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then -L_FOUNDLINE = T"
Params=FOLDER
[Actions\Action58\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{L_FOUNDLINE}"
value2=STRING|"T"
[Actions\Action59]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_OUT"" with value ""{L_OUT} Date/Time Sent: {L_FILE_DATE} Log File Nam..."""
Params=FOLDER
[Actions\Action59\Params]
expand=STRING|"1"
varname=STRING|"L_OUT"
varvalue=STRING|"{L_OUT} Date/Time Sent: {L_FILE_DATE} Log File Name: {L_LOGID} {EOL} File Sent/Recieved: {L_FILE_NAME} File Status: {L_CURR_STATUS}{EOL}{EOL}"
[Actions\Action6]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_NEW_DATE"" with value ""2013/04/02"""
Params=FOLDER
[Actions\Action6\Params]
expand=STRING|"1"
varname=STRING|"L_NEW_DATE"
varvalue=STRING|"2013/04/02"
[Actions\Action60]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action61]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_FILE_NAME"" with value """""
Params=FOLDER
[Actions\Action61\Params]
expand=STRING|"0"
varname=STRING|"L_FILE_NAME"
[Actions\Action62]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_FILE_DATE"" with value """""
Params=FOLDER
[Actions\Action62\Params]
expand=STRING|"0"
varname=STRING|"L_FILE_DATE"
[Actions\Action63]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_LOGID"" with value """""
Params=FOLDER
[Actions\Action63\Params]
expand=STRING|"0"
varname=STRING|"L_LOGID"
[Actions\Action64]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|0
Name=STRING|"Set variable ""L_FILE_STATUS"" with value """""
Params=FOLDER
[Actions\Action64\Params]
expand=STRING|"0"
varname=STRING|"L_FILE_STATUS"
[Actions\Action65]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If - Date Process loop"
[Actions\Action66]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop - through log file"
[Actions\Action67]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop through RoboFTP folder"
[Actions\Action68]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file C:\scann\L_MAILFILE.txt"
Params=FOLDER
[Actions\Action69]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action69\Params]
message=STRING|"Process complete. Processed {L_LINE_COUNT} lines of {L_TOTAL_LINE_COUNT}."
type=STRING|"3"
[Actions\Action7]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//*--File loop set for files newer than 1 month"
Params=FOLDER
[Actions\Action7\Params]
comment=STRING|"*--File loop set for files newer than 1 month"
[Actions\Action8]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop - through RoboFTP log folder"
Params=FOLDER
[Actions\Action8\Params]
createmode=STRING|"2"
createormodified=STRING|"1"
date1=STRING|"20130214"
date2=STRING|"20130214"
destvar=STRING|"L_CUR_FILE"
DuringDays=STRING|"10"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"4"
file0=STRING|"C:\RoboFTP LOG files\*.log"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"
[Actions\Action9]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""L_LOG_FILE_NAME"" with value ""{ExtractFileName({L_CUR_FILE})}"""
Params=FOLDER
[Actions\Action9\Params]
expand=STRING|"1"
varname=STRING|"L_LOG_FILE_NAME"
varvalue=STRING|"{ExtractFileName({L_CUR_FILE})}"
Re: Variable not setting properly
Why the step #68 (Create text file C:\scann\L_MAILFILE.txt) have no parameters?
What is the text body?
Could you send a couple of log files to my private mail (oleg(at)robotask.com) for testing?
What is the text body?
Could you send a couple of log files to my private mail (oleg(at)robotask.com) for testing?
Oleg Yershov
Re: Variable not setting properly
Hi Oleg,
The text body is the value of {L_OUT}.
Sent testing files to email provided.
Thanks
Naras
The text body is the value of {L_OUT}.
Sent testing files to email provided.
Thanks
Naras
Re: Variable not setting properly
Thank yoiu for your examples
I got such file:
It seems the result is correct.
I got such file:
Code: Select all
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status:
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: File Status:
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status:
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status: :*Download complete, 3 files received.
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status: :*Download complete, 3 files received.
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status: :*Download complete, 3 files received.
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status: :*Download complete, 3 files received.
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status: :*Download complete, 3 files received.
Date/Time Sent: 2013-04-02 10:20 Log File Name: dl_script_sample.log
File Sent/Recieved: Filename File Status: :*Download complete, 3 files received.
Date/Time Sent: 2013-04-02 16:12 Log File Name: ul_script_sample.log
File Sent/Recieved: Filename.txt File Status:
Date/Time Sent: 2013-04-02 16:12 Log File Name: ul_script_sample.log
File Sent/Recieved: Filename.txt File Status: :*Upload complete, 1 file sent.
Date/Time Sent: 2013-04-02 16:12 Log File Name: ul_script_sample.log
File Sent/Recieved: Filename.txt File Status: :*Upload complete, 1 file sent.
Date/Time Sent: 2013-04-02 16:12 Log File Name: ul_script_sample.log
File Sent/Recieved: Filename.txt File Status: :*Upload complete, 1 file sent.
Date/Time Sent: 2013-04-02 16:12 Log File Name: ul_script_sample.log
File Sent/Recieved: Filename.txt File Status: :*Upload complete, 1 file sent.
Date/Time Sent: 2013-04-02 16:12 Log File Name: ul_script_sample.log
File Sent/Recieved: Filename.txt File Status: :*Upload complete, 1 file sent.
Oleg Yershov
Re: Variable not setting properly
HI Oleg,
I guess my question is why doesn't the File Status set on lines (2 , 5 & 8) of the dl file and line 27 of the ul file in your example?
Naras
I guess my question is why doesn't the File Status set on lines (2 , 5 & 8) of the dl file and line 27 of the ul file in your example?
Naras
Re: Variable not setting properly
Unfortunately you use a very complicated algorithm...
I guess that this can be simplified.
You assign variable only in one step (#48)
Look at the steps #46-#49
You try to find substring *Download
Look at the line in the log:
[2013-04-02 10:20:32,407:0x000022d8]:*Receiving to "Filename"
This string doesn't contain substring *Download, so you get the empty variable and empty status
You can find *Download only at 4-th line.
Another remark: you should reset the L_DL_STATUS to empty value at the end of the loop (or at the beginning of the loop).
Next lines of your log (5, 6, 7) contain incorrect value (*Download complete, 3 files received) This should be empty too.
I guess that this can be simplified.
You assign variable only in one step (#48)
Look at the steps #46-#49
You try to find substring *Download
Look at the line in the log:
[2013-04-02 10:20:32,407:0x000022d8]:*Receiving to "Filename"
This string doesn't contain substring *Download, so you get the empty variable and empty status
You can find *Download only at 4-th line.
Another remark: you should reset the L_DL_STATUS to empty value at the end of the loop (or at the beginning of the loop).
Next lines of your log (5, 6, 7) contain incorrect value (*Download complete, 3 files received) This should be empty too.
Oleg Yershov
Re: Variable not setting properly
Hi Oleg,
Thanks very much for all your help. I'll continue to look for a way to process the info!
Naras
Thanks very much for all your help. I'll continue to look for a way to process the info!
Naras