title: extracting rows from CSV file based on specific keywords
body: <p><a href="https://i.stack.imgur.com/PkJmH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PkJmH.jpg" alt="enter image description here"></a></p>
  
  <p>I have created a code to help me retrieving the data from csv file</p>
  
  <pre><code>  import re
  keywords = {"metal", "energy", "team", "sheet", "solar" "financial", "transportation", "electrical", "scientists",
              "electronic", "workers"}  # all your keywords
  
  
  keyre=re.compile("energy",re.IGNORECASE)
  with open("2006-data-8-8-2016.csv") as infile:
      with open("new_data.csv", "w") as outfile:
          outfile.write(infile.readline())  # Save the header
          for line in infile:
              if len(keyre.findall(line))&gt;0:
                  outfile.write(line)
  </code></pre>
  
  <p>I need it to look for each keyword in two main columns which are "position" and "Job description" , and then take the whole row that includes these words and write them in the new file. Any ideas on how this can be done in the simplest way? </p>