title: Read files in folder and then do something by groovy
body: <p>I have write a script to read the file and then do something from specified path:</p>
  
  <pre><code>def file = new File(/"a.txt"/)
  def s = []
  s = file.filterLine  { it.contains("project ")}
  def array = []
  def a = []
  array &lt;&lt; s.toString().split(/(&lt;|=|:|"|,|\/&gt;)/)
  a = array.find{ it.contains("SYN_3-1_M5_integration")}
  b = a.findAll { it.startsWith("SYN_3")}
  println b.unique()
  </code></pre>
  
  <p>I just want to asked if I have a lot of txt file how can I use above code. I am a newbie in Groovy. Thanks in advance!</p>