Multiple Commands in one line

416 views
Skip to first unread message

Waseem Mohamed Laher

unread,
Apr 10, 2020, 10:24:11 AM4/10/20
to GAM for G Suite

I would like to add multiple courses to a batch of users.
I created a CSV file with about 27 columns. Each column has a different course id. The last column, column 28 is a the user email list. 


Here's the two methods I tried with no success.


1. I tried running the command "gam csv FET.csv gam course ~id1 add student ~email gam course ~id2 add student ~email"

It only added the id's in column id1.
I'd like it to go all the way to id27 in one command line.


2. I tried making a batch file as follows:

gam csv FET.csv gam course ~id2 add student ~email

gam csv FET.csv gam course ~id3 add student ~email

gam csv FET.csv gam course ~id4 add student ~email

gam csv FET.csv gam course ~id5 add student ~email

etc

This did not work either. I limited processes to one. I inserted commit-batch after each line.

I tried it with just one line, and I figured that a CSV command does not work from a batch file.


Is there any way to do this?

Ross Scroggs

unread,
Apr 10, 2020, 1:41:59 PM4/10/20
to google-ap...@googlegroups.com
Waseem,

With Advanced GAM (https://github.com/taers232c/GAMADV-XTD3) you can do this.

gam csv FET.csv gam courses "~~id1~~,~~id2~~,~~id3~~,~~id4~~,~~id5~~,~~id6~~,~~id7~~,~~id8~~,~~id9~~,~~id10~~,~~id11~~,~~id12~~,~~id13~~,~~id14~~,~~id15~~,~~id16~~,~~id17~~,~~id18~~,~~id19~~,~~id20~~,~~id21~~,~~id21~~,~~id22~~,~~id23~~,~~id24~~,~~id125~~,~~id26~~,~~id27~~" add students "~email"

Ross


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/c401aaa2-66f3-4e8f-8488-3db92430ff67%40googlegroups.com.

Waseem Mohamed Laher

unread,
Apr 10, 2020, 3:11:01 PM4/10/20
to GAM for G Suite
Thank you Ross.

Will give it a go.


On Friday, April 10, 2020 at 7:41:59 PM UTC+2, Ross Scroggs wrote:
gam csv FET.csv gam courses "~~id1~~,~~id2~~,~~id3~~,~~id4~~,~~id5~~,~~id6~~,~~id7~~,~~id8~~,~~id9~~,~~id10~~,~~id11~~,~~id12~~,~~id13~~,~~id14~~,~~id15~~,~~id16~~,~~id17~~,~~id18~~,~~id19~~,~~id20~~,~~id21~~,~~id21~~,~~id22~~,~~id23~~,~~id24~~,~~id125~~,~~id26~~,~~id27~~" add students "~email"

Ross

On Apr 10, 2020, at 7:24 AM, Waseem Mohamed Laher <wml...@gmail.com> wrote:

I would like to add multiple courses to a batch of users.
I created a CSV file with about 27 columns. Each column has a different course id. The last column, column 28 is a the user email list. 


Here's the two methods I tried with no success.


1. I tried running the command "gam csv FET.csv gam course ~id1 add student ~email gam course ~id2 add student ~email"

It only added the id's in column id1.
I'd like it to go all the way to id27 in one command line.


2. I tried making a batch file as follows:

gam csv FET.csv gam course ~id2 add student ~email

gam csv FET.csv gam course ~id3 add student ~email

gam csv FET.csv gam course ~id4 add student ~email

gam csv FET.csv gam course ~id5 add student ~email

etc

This did not work either. I limited processes to one. I inserted commit-batch after each line.

I tried it with just one line, and I figured that a CSV command does not work from a batch file.


Is there any way to do this?


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages