Hi hblount,
You can do this now. You have to make two jobs, one job will run the process (j1) and one job is handling the files (j2).
(j1)
Run Process(j1t1) Set Variable
(j1t2) .NET code Execute
(j1t3) Job/Task control
(j1t4) Calculate Variable
(j1t5) Set Variable
(j2)
Process Files(j2t1) Copy file
You have to have a int32 User Defined Variable. Call it LoopCounter.
In (j1t1) set this variable to 1.
Use this c# .NET code in (j1t2)
using System;
using System.IO;
using System.Text;
public class Test
{
public static string GetFileSection(int counter, string path, string pattern)
{
StringBuilder sb = new StringBuilder();
string[] files = Directory.GetFiles(path,pattern);
int MAX = 10;
for(int x = (counter-1)*MAX ; x<counter*MAX;x++)
{
try{sb.AppendLine(files❌);}
catch(Exception){}
}
return sb.ToString();
}
}
For the counter you use {USERVAR(LoopCounter)}
Use the correct path and pattern to match your files.
(j1t3) Runs (j2)
(j1t4) This task adds one to the LoopCounter variable.
(j1t5) This task sets the LoopCounter to 0. You have to add a condition to this task. This condition checks if the output of the .NET task (j1t2) is empty. A match is Continue and no match has to be set to Next.
To complete (j1) there has to be a loop. The loop starts on (j1t2) and ends on (j1t5). The loop settings are: loop while {USERVAR(LoopCounter)} Not Equal to 0.
The next job (j2) is doing all your file handling. Could be more than one task if you want. But I did only the file copy task (j2t1). This task has a loop and uses the foreach setting. The input for the loop is the output of the .NET task (j1t2).
So j1 runs and will show all the files and j2 is handling the shown files.
Hope this helps you.
Regards,
Erik
Uses Visualcron since 2006.