taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
732 stars 86 forks source link

gam print classroominvitations returns list of invalid results before CSV #121

Closed ShaunNeighbourSwale closed 3 years ago

ShaunNeighbourSwale commented 3 years ago

Hi

Executing "gam print classroominvitations role owner > output.csv" returns a list of courses without invitations, then the CSV header, then finally a list of invitations.

Any way of either ignoring the classes without invitations, or at least just including them under the CSV header with null values?

taers232c commented 3 years ago

GAM has to query each class for invitations, that's what these lines are:

Course: Eng7A (27258147157), Print 0 Classroom Owner Invitations (296/316)

You're getting these lines in your CSV file because of > output.csv. To get just the CSV data in the CSV file do the following:

gam redirect csv ./output.csv print classroominvitations role owner

You'll get the progress messages on the screen and the CSV data in outout.csv.

See: https://github.com/taers232c/GAMADV-XTD3/wiki/Meta-Commands-and-File-Redirection#file-redirection

ShaunNeighbourSwale commented 3 years ago

Thank you!