title: Read a file and compare the contents of the file to pipeline parameters using Groovy
body: <p>I have a file file.txt that gets created with some content, sample as below</p>
  
  <pre><code> /abc/jenkins/data/jobs/random/workspace/file.txt - With below content 
    ------------------------- 
   [abc, hde, jef ,dgd , 1243, 324# ,23534 ....]
    ==&gt; First step
    id - 1235
    branch - 104
    path - dthdp:/opt/usr/nimb/src/emc/crm/104/mat/1235
    area - crm
    rev - 10
    status - Running
  </code></pre>
  
  <p>I have set of parameters that i get as input from my pipeline</p>
  
  <pre><code>  **Sample parameters**
    buildnum - 1235
    prod - crm
    trunk - 104 ... etc 
  </code></pre>
  
  <p>I am trying to read the file and compare its data to the parameters and Print "All the parameters match" if </p>
  
  <pre><code> [ buildnum parameter = id  value in file , prod parameter= area value in file , branch parameter = trunk value in file ] 
  </code></pre>
  
  <p>Can anyone help how to write it in groovy , below doesn't work</p>
  
  <pre><code>    def file = new File(env.WORKSPACE+"/file.txt")
              def lineCount = 0
            file.eachLine { line -&gt;
      def parts = line.split '\n'
                println "parts"
      if ( parts != 'params.buildnum' )
         System.err.println "Failure! Doesnt match with buildnm..."
      if ( parts !=  'params.trunk' )
        System.err.println "Failure! Doesnt match with trunk..."
       lineCount++
  </code></pre>