0

I am able to read the data one by one in a loop but i want to get all of the data into an array. the below code is what i am using to get text file content into an array one by one.

    var linkurl; 
    linkurl =  "CODE:";
    linkurl +=  "SET !DATASOURCE C:\\Users\\InsaneRydr\\Documents\\iMacros\\Downloads\\link-realtor-profile.csv" + "\n";
    linkurl +=  "SET !DATASOURCE_LINE {{ee}}" + "\n";
    linkurl +=  "SET !EXTRACT {{!COL1}}" + "\n";  

for (var ee =1; ee<=100000000; ee++)
{
ret = iimSet("ee", ee);
 retcode = iimPlay(linkurl)
 var s = iimGetLastExtract(1);
if(retcode<0){
          break;
          }
          else {          
    listy.push(s);
}
}

But i want to get all of the data from text file into an array in a single run not by looping each line.

3
  • You cannot pass iMacros variables to javascript. You can pass javascript vars to iMacros, however. Take a look at this question and its answer: stackoverflow.com/questions/22031719/… - just an example, you should be able to find more/others/better. If I were you I would read the file with javascript, have my array, and then pass the variable or variables to iMacros Commented Jun 6, 2017 at 10:29
  • @flish How do you get the data of a text file containing multiple lines into an array via javascript instead of imacros. This would be great help if you can teach me. Commented Jun 6, 2017 at 18:14
  • A lot depends on the structure of your file. Take a look at my script. There var excLinks is an array with the values from a text file. Commented Jun 7, 2017 at 12:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.