title: How to split comma separated string into 3 variables in Beanshell Preprocessor?
body: <p>I have the following values in <code>user defined variables</code>, like</p>
  
  <pre><code>10001,1.2.840.13456.2.40.4.8323328.55551296.600114,D:\\Share\\DataSetCreation\\UPLOAD\\P7\\S1 (separated by comma)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/aEPS8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aEPS8.jpg" alt="User Defined Variables"></a>
  In the <code>BeanShell Preprocessor</code>, I want to read these values and split into 3 variables based on the iteration.</p>
  
  <p>For example for iteration1 for any user, I want upload1 and for iteration2 and I want upload2 data split into 3 variables.</p>
  
  <p>How can I use <code>${__iterationNum}</code> in the below code to read the data from each user defined variables?</p>
  
  <pre><code>String data1 ="${upload2}";
  String[] uploaddata = data1.split(",");
  for (int i = 0; i &lt; uploaddata.length; i++)
  { log.info(uploaddata[i]); 
  log.info("Value is: " + uploaddata[i]); }
  </code></pre>