Page 1 of 1

String to RowSet to use in a Loop

Posted: Tue Jul 20, 2010 11:07 am
by smandadi
Pseudo Code
Variable: myVar=abc,def,xyz
for each myVar
FTP
endfor

How can I achieve this.. I can use either of the loop options (Do, While or For), and the variable is under our control,
We can use Comma Seperated, or, If its not possible even XML would be fine..

Just need a way to manipulate loops using variables.....

Re: String to RowSet to use in a Loop

Posted: Tue Jul 20, 2010 3:20 pm
by Support_Duane
GoAnywhere does not currently (as of July 2010) allow string operations on variables, so you cannot pass in a string and use pieces of it in your loop. What you can do, however, is to place the values into separate records in a file, (any of the file types that GoAnywhere can read - Database, CSV, Fixed Width, Excel, XML) read that file, then set up a For Each loop based on the value in each record.

Re: String to RowSet to use in a Loop

Posted: Wed Sep 28, 2016 10:42 am
by cmayil
Hello Team,

Could you please let us know whether this feature implemented in the latest version as of 28th Sep-2016.
Thanks

Re: String to RowSet to use in a Loop

Posted: Wed Sep 28, 2016 12:58 pm
by Support_Rick
Yes, there have been many improvements to the product since July, 2010. Please check out the Release Notes on MFT and Director to see the progression and how this has grown.

Re: String to RowSet to use in a Loop

Posted: Thu Sep 29, 2016 4:11 am
by cmayil
Hi Rick,
We are using Version 5.1.5. I dont see the option for string splitting.

Re: String to RowSet to use in a Loop

Posted: Thu Sep 29, 2016 7:57 am
by Support_Rick
We've had several enhancements .. but, not this specifically.

As Duane mentioned above, it can be accomplished by writing the values out to a CSV (etc) then reading them into a RowSet variable, then looping that RowSet.

Pseudo Code:
Code: Select all
Print -> Temp.csv
CDATA[[
   ${var1},${system.carriageReturn}
   ${var2},${system.carriageReturn}
   ${var3},${system.carriageReturn}
]]

ReadCSV (Temp.csv) -> MyRowset

ForEach ${MyRowset} -> Rec
   call FTP parm resourceID=${Rec[1]}
endForEach