String to RowSet to use in a Loop
Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
6 posts
Page 1 of 1
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.....
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.....
- Support Specialist
- Posts: 66
- Joined: Thu Mar 05, 2009 3:49 pm
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.
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
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.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
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:
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
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
6 posts
Page 1 of 1