title: How to compare 2 CSV files in powershell
body: <p>I'm trying to compare 2 CSV files with logs info in (logs_all, logs_new)
  format:  </p>
  
  <p><a href="https://i.stack.imgur.com/xesVX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xesVX.png" alt="enter image description here"></a></p>
  
  <p>I want to add the rows they don't exist in logs_all from logs_new </p>
  
  <pre><code>$csv1 = Import-Csv $csvLogs_all -Delimiter "`t"
  $csv2 = Import-Csv $csvLogs_new -Delimiter "`t"
  
  $end     = $csv1.Count
  $count   = 0
  $diffobj = @()
  
  # testtable is the name of the column, adjust it to your column header name
  if($csv1.time[$count] -ne $csv2.time){
     $diffobj += $csv2[$count]
  }
  
  $count++
  }until($count -eq $end)
  Write-Host "chekking logs"
  $diffobj | export-csv $csvLogs_all -NoTypeInformation
  </code></pre>
  
  <p>but this isn't working well, can some help me?</p>