String Variables - VisualCron - Forum

Community forum


I am trying to get a portion of a string from a file that contains 1 line like
date operator jobcode jobname+
the length of the jobname can vary, but it always begins in the same spot, in this case 22 and it always ends with "+"

so I have a varialble

that returns 29 which is the column number of the string delimiter, now I would like to calculate the length of the jobname by subtracting 22 and then use the result: 7 as an argument to the substring function below


which should return "jobname"

The idea is to have a variable that contains the jobname no matter how long or short it is.

Can you help me, please??

We don't support operators there.

What about using this function instead - it will always return jobName:

Please like  VisualCron on facebook!
Thanks for your response!

The file name that I used in the File(content) was misleading, the name of the file has no relation to the Jobname string that I am trying to extract.

Is there someway to use the following as an argument for the substring length?


where varIndex ={STRING(LastIndexOf,{FILE(Content,c:\files\out\jobNAME.dat)},+)}
unfortunately the {MATH(Subtract|... doesn't work, is it because the {USERVAR(varIndex)} is the wrong type??
It seems like you are trying to make something simple very hard here :)

Instead of going through your UserVariable I would use the Variables directly instead. And maybe, even this can be done within VisualCron it may not be as efficient as just writing a batch file instead or use other scripting.
Please like  VisualCron on facebook!
Scroll to Top