Skip to content

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.
  • smandadi Offline
  • Posts: 17
  • Joined: Mon Jun 14, 2010 3:58 pm

String to RowSet to use in a Loop

Post 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.....
  • Support_Duane Offline
  • Support Specialist
  • Posts: 66
  • Joined: Thu Mar 05, 2009 3:49 pm

Re: String to RowSet to use in a Loop

Post 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.
  • cmayil Offline
  • Posts: 7
  • Joined: Thu Sep 08, 2016 8:43 am

Re: String to RowSet to use in a Loop

Post by cmayil »

Hello Team,

Could you please let us know whether this feature implemented in the latest version as of 28th Sep-2016.
Thanks
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: String to RowSet to use in a Loop

Post 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.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
  • cmayil Offline
  • Posts: 7
  • Joined: Thu Sep 08, 2016 8:43 am

Re: String to RowSet to use in a Loop

Post by cmayil »

Hi Rick,
We are using Version 5.1.5. I dont see the option for string splitting.
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: String to RowSet to use in a Loop

Post 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
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Post Reply