In a job triggered by a file appearing in a folder, the first task attempts to set a job variable equal to the number of rows in the file minus 2 for the header and footer rows. I am using a formula for this I found by searching in the forum here: {STRING(RowCount|{FILE(Content|g:\temp\test.txt)})}-2
The actual task looks like this:
{STRING(RowCount|{FILE(Content|{JOB(Active,Variable,JobWorkingDir)}\{TRIGGER(Active,LastTrigger,File.Result.Name)})})}-2
The result ends up being "1-2" (I now realize I'll need to use a math function to do the subtraction once I get this figured out). It seems the folder\filename gets resolved to a valid path which is 1 line, then the 1 line is counted instead of the file's content's being read by the rowcount function.
What am I doing wrong? Can't one use job variables for the PATH/FILENAME in the FILE/Content function? Or do I need to resolve those first somehow before rowcount sees them?
Thanks,
Gary
Edited by moderator
2017-03-03T07:22:54Z
|
Reason: Not specified