kind of.
REGEX cant read single lines, so I had to do it in steps, since I have 50 lines.
Did this:
loop start
Task1:
Read the file with the paths with a powershell command:
Get-Content D:\FOAWINBATCH\fil\hent_finans_klar_til_afsend.txt | Select-Object -first 1
Task2:
In the next step I had to remove the firstline in the file and save it en another file named _temp, powershell command:
Get-Content D:\FOAWINBATCH\fil\hent_finans_klar_til_afsend.txt | Select-Object -Skip 1 | Out-File D:\FOAWINBATCH\fil\hent_finans_klar_til_afsend_temp.txt
Task3:
Next step i regex the folder name from the StdOut from the first step:
Foldername in FTP, where to download from Remote Filefilter:
{REGEX(Replace|{TASK(e9a26187-f749-4c80-96f7-f36aca9c816f|StdOut)}| .*|)}
Foldername in FTP where to download to:
{REGEX(Replace|{TASK(e9a26187-f749-4c80-96f7-f36aca9c816f|StdOut)}|^([^ ]+ ){1}|)}
Task4:
Finally I copy the _temp file to the original filename, so in step 1 it kan read it again, just one less line.
It loops through the step as long as hent_finans_klar_til_afsend.txt have a size > 0.
it works, but if you have an easier way to do this, you are welcome to comment on this solution :-)