title: Powershell import-csv - automatically recognize delimiter?
body: <p>so I work with some CSV files generated on different places. For example server has different regional settings then my laptop so the file can be delimited by , or ;
  If I don't specify -delimiter parameter it seems that powershell is simply unable to see that the CSV file is delimited via , so yes use that! I want to have a universal script which does not care about the CSV file origin. Seems like the only way to properly import a CSV file when you don't know the delimiter is something like this:</p>
  
  <pre><code>$line=gc "list1.csv"|select -first 1
  if($line-like "*,*" -and -not ($line-like "*;*")){
      $list1=Import-Csv "list1.csv" -Delimiter ","
  }else{
      $list1=Import-Csv "list1.csv" -Delimiter ";"
  }
  </code></pre>
  
  <p>Anybody has a better idea?</p>