You should be able to pipe the command to a csv.
gam print users allfields > users.csv
It also supports a query (by Org Unit for example)
gam print users allfields query "orgUnitPath='/Users'" > users.csv