PowerShell / PowerShell

PowerShell for every system!
https://microsoft.com/PowerShell
MIT License
45.01k stars 7.27k forks source link

Additional Parameters for Import-CSV and Export-CSV #11754

Closed scotthardwick closed 11 months ago

scotthardwick commented 4 years ago

(If I need to break this feature request up into a multiple, I can do so. Wasn't sure if I should break it based on Import/Export, or to post one per new parameter suggestion. In the end I have bundled all these suggestions together.)

As the programmers work towards PowerShell 7's final release, I wanted to suggest perhaps we strengthen some of the options that are available in PowerShell's CSV cmdlets (Import-CSV, Export-CSV, ConvertTo-CSV, ConvertFrom-CSV).

I can't speak for every programmer everywhere, but as an admin scripter working with legacy systems, I find I do a lot of processing on CSV files that are batch created and dumped somewhere for me. While PowerShell has a good few features, I still find myself pre-processing the file and then post fixing the object. Below are some suggestions that might make it easier for CSV users. I don't think any of these should be controversial and none of this should break existing code.

PowerShell's code for CSV operations seems to be based around: src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs

Import

Export

vexx32 commented 4 years ago

@scotthardwick can you please add some formatting to your post? As it is, it's very much a block of text and quite hard to read.

Thanks! 😊

scotthardwick commented 4 years ago

@vexx32 Thanks for the suggestion. I have gone in and done some formatting. Hope that helps!

iRon7 commented 4 years ago

I don't think it is a good idea to add (common) parameters like -Last, -First, -Skip and -SkipLast to just these two cmdlets. Instead:

Or:

Andrei-Paul commented 3 years ago

OMG YES please. I would have loved me some escape char support the past few days.

-UseQuotes ie, Never/Always/AsNeeded - Python also has NonNumeric, it would be nice to have data feature parity between the 2.

What python doesn't have and would be nice to have would be to distinguish between empty strings and $null, by quoting one but not the other. Why? Because an empty response is not the same thing as no response at all.

microsoft-github-policy-service[bot] commented 11 months ago

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

microsoft-github-policy-service[bot] commented 11 months ago

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

microsoft-github-policy-service[bot] commented 11 months ago

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

microsoft-github-policy-service[bot] commented 11 months ago

This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.