title: imacros extract 2 parts of data + concatenate constant save to file javascript
body: <p>I need to extract 2 parts of data in 2 different columns then concatenate with a string and save to file. see below example how i am expecting data to be saved. </p>
  
  <p>I am getting syntax errors and it may not be producing expected result. i spotted errors with comments below.</p>
  
  <pre><code>//each row is written as below
  //part1 = 182.30.2.129; 
  //part2 = ":"; 
  //part3 = 8080; 
  //finalvalue = 182.30.2.129:8080 - like this it will write row by row
  
  var jsLF="\n";
  var ret=null;
  
  var proxynovaurl; //open url
  proxynovaurl  =  "CODE:";
  proxynovaurl +=  "VERSION BUILD=9002379" + jsLF; 
  proxynovaurl +=  "TAB T=1" + jsLF; 
  proxynovaurl +=  "TAB CLOSEALLOTHERS" + jsLF; 
  proxynovaurl +=  "URL GOTO=http://www.proxynova.com/proxy-server-list/anonymous-proxies/" + jsLF; 
  
  var proxynova; //extract part #1 value
  proxynova =  "CODE:";
  proxynova += "VERSION BUILD=9002379" + jsLF; 
  proxynova += "TAB T=1" + jsLF; 
  proxynova += "TAB CLOSEALLOTHERS" + jsLF; 
  proxynova += "TAG POS={{i}} TYPE=TD ATTR=* EXTRACT=TXT" + jsLF;
  proxynova += "SET !VAR1 {{!EXTRACT}}" + jsLF; //** Potential error in syntax **//
  proxynova += "SET !EXTRACT NULL" + jsLF;
  //proxynova += "SAVEAS TYPE=EXTRACT FOLDER=C:\\  FILE=ip-address.csv" + jsLF;
  
  var proxynovamid; //use constant for part #2 value
  proxynovamid =  "CODE:";
  proxynovamid += "VERSION BUILD=9002379" + jsLF; 
  proxynovamid += "TAB T=1" + jsLF; 
  proxynovamid += "TAB CLOSEALLOTHERS" + jsLF; 
  //proxynovamid += "TAG POS={{j}} TYPE=TD ATTR=* EXTRACT=TXT" + jsLF;
  proxynovamid += "SET !VAR2 ':'" + jsLF; //** Potential error in syntax **//
  //proxynovamid += "SET !EXTRACT NULL" + jsLF;
  
  var proxynova1; //extract part #3 value
  proxynova1 =  "CODE:";
  proxynova1 += "VERSION BUILD=9002379" + jsLF; 
  proxynova1 += "TAB T=1" + jsLF; 
  proxynova1 += "TAB CLOSEALLOTHERS" + jsLF; 
  proxynova1 += "TAG POS={{j}} TYPE=TD ATTR=* EXTRACT=TXT" + jsLF;
  proxynova1 += "SET !VAR3 {{!EXTRACT}}" + jsLF; //** Potential error in syntax **//
  proxynova1 += "SET !EXTRACT NULL" + jsLF;
  
  var proxynovafinal;
  proxynovafinal =  "CODE:";
  proxynovafinal += "ADD !EXTRACT {{VAR1}} + jsLF; //** Potential error in syntax **//
  proxynovafinal += "ADD !EXTRACT {{VAR2}} + jsLF; //** Potential error in syntax **//
  proxynovafinal += "ADD !EXTRACT {{VAR3}} + jsLF; //** Potential error in syntax **//
  proxynovafinal += "SAVEAS TYPE=EXTRACT FOLDER=C:\\  FILE=ip-address.csv" + jsLF;
  
  iimPlay(proxynovaurl); //launch url
  
  for(var i=1;i&lt;=236;i=i+6) //1st loop extract 1st part of value
  {
  iimDisplay(i);
  iimSet("i", i);
  iimPlay(proxynova);
  iimSet("i",i);
  
  iimSet("j",i+1);
  //for(var j=17;j&lt;=37;j=j+5) 
  //{
  //iimDisplay(j);
  //iimSet("j", j);
  iimPlay(proxynovamid); //extract 2nd part of value
  iimPlay(proxynova1);   //extract 3rd part of value
  iimSet("j",i+1);
  iimPlay(proxynovafinal); //write final concatinated value to file (Part1+part2+part3)
  }
  </code></pre>