Title: Import-Csv does not handle newlines containing just \r (Carriage Return) · Issue #3692 · PowerShell/PowerShell · GitHub
Open Graph Title: Import-Csv does not handle newlines containing just \r (Carriage Return) · Issue #3692 · PowerShell/PowerShell
X Title: Import-Csv does not handle newlines containing just \r (Carriage Return) · Issue #3692 · PowerShell/PowerShell
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 pre...
Open Graph 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...
X 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 behav...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/3692
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Import-Csv does not handle newlines containing just \\r (Carriage Return)","articleBody":"Steps to reproduce\r\n------------------\r\n\"one,two,three`rthree,three,three\" | out-file test.csv \r\nimport-csv test.csv\r\n\r\nExpected behavior\r\n-----------------\r\nExpected result:\r\n```\r\none two three\r\n--- --- -----\r\nthree three three\r\n```\r\n\r\nActual behavior\r\n---------------\r\nimport-csv : The member \"three\" is already present.\r\n\r\nEnvironment data\r\n----------------\r\nTested on windows 8.1 and windows X (10). \r\n```\r\nName Value\r\n---- -----\r\nPSVersion 5.1.14393.206\r\nPSEdition Desktop\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nBuildVersion 10.0.14393.206\r\nCLRVersion 4.0.30319.42000\r\nWSManStackVersion 3.0\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\n```\r\nSteps to fix\r\n----------------\r\nIt 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. \r\n\r\nIt looks like the code here:\r\n```\r\n\t\tprivate bool IsNewLine(char ch)\r\n\t\t{\r\n\t\t\tbool result = false;\r\n\t\t\tif (ch == '\\n')\r\n\t\t\t{\r\n\t\t\t\tresult = true;\r\n\t\t\t}\r\n\t\t\telse if (ch == '\\r' && this.PeekNextChar('\\n'))\r\n\t\t\t{\r\n\t\t\t\tresult = true;\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}\r\n```\r\n\r\nshould include \r\n```\r\n\t\t\telse if (ch == '\\r')\r\n\t\t\t{\r\n\t\t\t\tresult = true;\r\n\t\t\t}\r\n```\r\n\r\nand then all will be happy. Thanks!","author":{"url":"https://github.com/Szeraax","@type":"Person","name":"Szeraax"},"datePublished":"2017-05-03T19:07:37Z","url":"https://github.com/PowerShell/PowerShell/issues/3692"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:85fe801e-f9e4-4969-fcb1-bdf71382c536 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D16:27BAE:811E2:B30A4:6AFD8AD5 |
| html-safe-nonce | b2bbe92b9f206abbee6acb9ea1dcc2a6a3ee50868a06430991b42b30a7e6f1eb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDE2OjI3QkFFOjgxMUUyOkIzMEE0OjZBRkQ4QUQ1IiwidmlzaXRvcl9pZCI6IjI4NzAyNTY4MjU2OTg1Nzc0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aad8c3afdb30f08e0a75e95ced665f0b444922fde48fd4b5e6e35e6e46854fe6 |
| hovercard-subject-tag | issue:226084707 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/3692/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68d0abe6c03d52c7098fad07e6309a2b8ce58236258de6aee76084299a3c4c63/PowerShell/PowerShell/issues/3692 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68d0abe6c03d52c7098fad07e6309a2b8ce58236258de6aee76084299a3c4c63/PowerShell/PowerShell/issues/3692 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Szeraax |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width