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

smandadi

Posts: 17
Joined: Mon Jun 14, 2010 3:58 pm

Post by smandadi » Tue Jul 20, 2010 11:07 am
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.....

Support_Duane

Support Specialist
Posts: 66
Joined: Thu Mar 05, 2009 3:49 pm

Post by Support_Duane » Tue Jul 20, 2010 3:20 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.

cmayil

Posts: 7
Joined: Thu Sep 08, 2016 8:43 am

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

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

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Wed Sep 28, 2016 12:58 pm
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

cmayil

Posts: 7
Joined: Thu Sep 08, 2016 8:43 am

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

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Thu Sep 29, 2016 7:57 am
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
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
6 posts Page 1 of 1