To better view CSV files, use Notepad ++ . This will tell you the encoding of the file in the status bar. Also enable hidden characters (View> Show Character> Show All Characters). This will show if there are only linear channels, or carriage return + linear channels, tabs and spaces, etc. You can also change the encoding of the file in the "Encoding" menu. This can help you spot the differences. Notepad does not display this information.
Refresh . Here's how to convert a text file from Windows to Unix format in code:
$allText = [IO.File]::ReadAllText("C:\test.csv") -replace "`r`n?", "`n" $encoding = New-Object System.Text.ASCIIEncoding [IO.File]::WriteAllText("C:\test2.csv", $allText, $encoding)
Or you can use Notepad ++ (Edit> EOL Conversion> Unix Format).
source share