Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv output option #12624

Open
johanburati opened this issue Mar 18, 2020 · 5 comments
Open

csv output option #12624

johanburati opened this issue Mar 18, 2020 · 5 comments
Assignees
Labels
Core CLI core infrastructure feature-request
Milestone

Comments

@johanburati
Copy link
Contributor

Would be good to have a csv output option, so that we could easily extract fields using good old linux cli commands and without redoing any formatting of any kind.

Like in the example below the first field has space in it.

$  az account list-locations -o table
DisplayName           Latitude    Longitude    Name
--------------------  ----------  -----------  ------------------
East Asia             22.267      114.188      eastasia
Southeast Asia        1.283       103.833      southeastasia
Central US            41.5908     -93.6208     centralus
East US               37.3719     -79.8164     eastus
East US 2             36.6681     -78.3889     eastus2
West US               37.783      -122.417     westus

Would be good to have this:

$  az account list-locations -o csv
East Asia,22.267,114.188,eastasia
Southeast Asia,1.283,103.833,southeastasia
Central US,41.5908,-93.6208,centralus
East US,37.3719,-79.8164,eastus
East US,2,36.6681,-78.3889,eastus2
West US,37.783,-122.417,westus
North Central US,41.8819,-87.6278,northcentralus
South Central US,29.4167,-98.5,southcentralus

So we can do things like this:

 $  az account list-locations -o csv | awk -F, '{ print  $4" -> "$1 }'
eastasia -> East Asia
southeastasia -> Southeast Asia
centralus -> Central US
eastus -> East US
eastus2 -> East US 2
westus -> West US

I think this option could come handy sometimes.

@yonzhan yonzhan added the Core CLI core infrastructure label Mar 18, 2020
@yonzhan yonzhan added this to the S168 milestone Mar 18, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 18, 2020

add to S168

@daryltucker
Copy link

This would help bridge a gap in being able to share information with colleagues using Office365/Excel as there are currently no easy alternative.

Thank you for your consideration.

@bitcjacobsen
Copy link

This should be simple to do. Why has it been 2 years without even an update? This is a sorely lacking feature with nary a decent workaround.

@fsdrw08
Copy link

fsdrw08 commented Mar 9, 2023

any update of this request?

@valentijnscholten
Copy link

I've been googling for 20 minutes now to find a way to get CSV output from azure cli in WSL2. Nothing seems to work. Is there an alternative that works? All the examples replacing tabs with comma's are not working because the output doesn't contain any tabs even when specifying tsv as output format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core CLI core infrastructure feature-request
Projects
None yet
Development

No branches or pull requests

9 participants