title: Groovy Reading and using data from .csv file in SoapUI
body: <p>I'm new to groovy script and what I'm trying to do is not working.
  What I try to do is:</p>
  
  <ul>
  <li>Read a .csv file</li>
  <li>Add the data from from the .csv file to a variable that I can use in XML (e.g. </li>
  </ul>
  
  <p>test.csv
  name,age
  Tester,20
  Java,30</p>
  
  <p>and use the Tester in a variable named name in the XML and 30 in a variable named 20)</p>
  
  <p>Which software / jar files do I use:</p>
  
  <ul>
  <li><p><a href="http://opencsv.sourceforge.net/" rel="nofollow noreferrer">OpenCSV v3.9</a> jar file added to the SoapUI directory: bin/ext</p></li>
  <li><p><a href="https://github.com/xlson/groovycsv" rel="nofollow noreferrer">GroovyCSV v1.1</a> jar file added to the SoapUI directory: bin/ext</p></li>
  <li><p>SoapUI 5.2.1.</p></li>
  </ul>
  
  <p>I searched Google on how to do this and used the following code to try to get it working:</p>
  
  <pre><code>   @Grab('com.xlson.groovycsv:groovycsv:1.1')
  import static com.xlson.groovycsv.CsvParser.parseCsv
  
  def csv = '''Name,Lastname
  Mark,Andersson
  Pete,Hansen'''
  
  def data = parseCsv(csv)
  for(line in data) {
      println "$line.Name $line.Lastname"
  }
  </code></pre>
  
  <p>This is what I used to see if everything is working but I am getting the following error code:</p>
  
  <pre><code>java.lang.noclassdeffounderror: org/apache/ivy/core/settings/Ivysettings
  </code></pre>
  
  <p>I searched Google for this but couldn't really find a good solution, please advise.</p>