input from text file to array

Discuss RoboTask here
Post Reply
Dev_
Posts: 4
Joined: Tue Apr 03, 2007 7:53 am
Location: Canada

input from text file to array

Post by Dev_ »

Hi I am new to RoboTask and have had a little difficulty with the software, i am sure that it will become easier as I go along but mean while I am hoping someone may have some help for me.
My problem is that I am trying to use Robotask to automate ftp-ing of files between different sites.  I am creating multiple text files with login and ftp info (see sample 1).  I am using the "File Loop" command to process the site info.  Then I am using the "Text Loop" comand to try to read to file into an array called PROFILE.  Line one is the ip that I would like in variable PROFILE(0),Line two is the username that I would like in variable PROFILE(1),Line three is the password that I would like in variable PROFILE(2),Line four is the remote directory that I would like in variable PROFILE(3),Line five is the local directory that I would like in variable PROFILE(4),Line six is the archive directory that I would like in variable PROFILE(5).  So in the set up for "Test Loop" under the "Store Current Line to Variable:" field I have entered "PROFILE({COUNT})" and I am runing a counter variable called "COUNT". But it reads all the lines from the file into "PROFILE(0)"  I have a variable PROFILE with value "" created at the begining of the action list.  
Does anyone know what I am doing wrong and how do I fix it.
 
**********************
Sample 1 - file name :profile1
10.10.10.1
user1
pass1
/root/usr/outbound
c:\usr\inbound
c:\arc\inbound
 
**********************
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

input from text file to array

Post by Oleg »

You just have to create a comma-separated string in order to use it as array.
Like this:
"value1", "value with spacebar", "value 3"
etc.


See this example. I hope this will help you.
Dev_
Posts: 4
Joined: Tue Apr 03, 2007 7:53 am
Location: Canada

input from text file to array

Post by Dev_ »

Thanks Oleg, that worked for the input into the array.
Post Reply