-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
Steps to reproduce
"one,two,three`rthree,three,three" | out-file test.csv
import-csv test.csv
Expected behavior
Expected result:
one two three
--- --- -----
three three three
Actual behavior
import-csv : The member "three" is already present.
Environment data
Tested on windows 8.1 and windows X (10).
Name Value
---- -----
PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Steps to fix
It seems that the ImportCsvHelper method located in my C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Utility.dll is the culprit.
It looks like the code here:
private bool IsNewLine(char ch)
{
bool result = false;
if (ch == '\n')
{
result = true;
}
else if (ch == '\r' && this.PeekNextChar('\n'))
{
result = true;
}
return result;
}
should include
else if (ch == '\r')
{
result = true;
}
and then all will be happy. Thanks!
mklement0
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module