title: Powershell CSV removing rows and then remove from whole file if A column matches
body: <p>I've created the following small script to remove 2++ strings from a CSV.
  Each row is a log of a given person and a answer they give.
  The CSV has X columns.
  The column named FIRST identifies the person.</p>
  <p>What I need to do is when I delete a row matching the answer, I also need to delete the person from the whole CSV if it had one of the two strings.</p>
  <p>What I've made so far, removes the row of people having the answers but the person is still left in the overall CSV with other answers. I want to remove the person fully if the questions have been answered.</p>
  <p>Can somebody help me out with making the addition or changes to make this happen?</p>
  <p><strong>INPUT File</strong></p>
  <pre><code>FIRST,LAST,ADDR,ADDR2,GENDER,HOME,WORK
  1,N/A,N/A,N/A,N/A,BAF,N/A
  10005,JAS,AA,N/A,,ZAV,N/A
  10007,JADE,BB,N/A,OMA,N/A,N/A
  10007,JADE,N/A,RAV,N/A,N/A,N/A
  10011,KIAH,N/A,N/A,BALI,BB,N/A
  </code></pre>
  <p><strong>SCRIPT</strong></p>
  <pre><code>$CSVfile = &quot;C:\Temp\Test\Test.csv&quot;
  $CSVfile_filtered = &quot;C:\Temp\Test\Test.csv&quot;
  
  $regex001 = &quot;AA&quot;
  $regex002 = &quot;BB&quot;
  
  
  $filterArray = @($regex001,$regex002)
  Get-Content $CSVfile | Select-String -pattern $filterArray -notmatch | Set-Content $CSVfile_filtered
  </code></pre>
  <p>The file should then remove 10005, 10011 and both lines of 10007. But my version only removes one of the 10007 since it only matches one of the two patterns.</p>