-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Export-Csv should have option to suppress quotes #8890
Copy link
Copy link
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Export-Csv should have option to suppress quotes
By default Export-Csv puts quotes around all fields. This isn't always necessary and some programs even have problems reading the results. For example, Export-Csv will quote a numbers and dates:
…,"227","6/1/2018 12:00:00 AM"Some programs then interpret the data as strings, which generally isn't the intent.
Also, quotes generally aren't required for strings (unless they contain the delimiter character).
Not using quotes (unless needed) would improve usability with other applications and reduce file output size.
Proposed technical implementation details
A couple options:
Any of these would solve my current problem (all of them would be a complete, powerful solution to most problems).
-UseQuotes options details:
There's a good argument to be made that the default behavior should be AsNeeded or StringsOnly as they tend to be more compatible with other applications; however, it would be different and could break existing usage.