title: How to handle dynamic columns for CSV file using Import-csv in PowerShell
body: <p>CSV file does not have headers, Column may differ each time.
  I want to compare with first column of csv file, but while exporting I would display the full row.</p>
  <pre><code>$getErrorCodes= {102,103}
  
  CSV FILE( No headers)
  101,101,101
  102,102,102
  </code></pre>
  <p>Here is my code</p>
  <pre><code>Import-Csv $CSVFile -Header col1 | Where-Object {!($getErrorCodes.Contains($_.col1)) } | Export-Csv &quot;resultfile.csv&quot;
  
  Current output
  101
  
  Expected output
  101,101,101
  </code></pre>