IMPORTANT:--
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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/79ab499c-aa79-4b4a-ad5e-c61a35e68135%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
That level of filtering isn't available in the API or GAM but could easily be done in a Sheet:gam print groups to driveAnd then filter to your hearts content in the Google Spreadsheet.Jay
On Wed, May 30, 2018, 8:59 AM Andrea <andrea....@consultant.solgroup.com> wrote:
Hi all.I need to list all groups that name (or description) match a string .A command like this:gam print groups where name (or description) like "RED"It's possible with GAM ?I'm not able (I'm a little goat :)Please, help me.Thank you all !!Andrea
IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.
Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.--
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.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Formatter {
public static void main(String[] args) {
try {
/*import CSV files created with GAM Query
* Contents of CSV file when imported:
* primaryEmail,customSchemas.Test.Test (Headers Important to include first line)
* User...@email.com, (Values in the format primaryEmail,Schema)
* User...@email.com,Staff (Line I want to remove from CSV file)
* User...@email.com, (Line I want to keep in CSV to update)
*
* Desired output from CSV:
* primaryEmail,customSchemas.Test.Test (Headers Important to include first line)
* User...@email.com, (Values in the format primaryEmail,Schema)
* User...@email.com, (Line I want to keep in CSV to update)
*
* IO Exception (OR) 'Execution Complete' (Shown in Interface Console [command prompt])
* */
File read1 = new File("CSV File Path IE: 'C:\\file.csv"); //I am formatting two files, 1 and 2.
File read2 = new File("C:\\Staff.csv"); //Example
File write1 = new File("CSV File Path for the new CSV File"); //This is the file the app is creating
File write2 = new File("C:\\StaffFormatted.csv"); //Example
String lineToRemove1 = ",Customer"; //Values to be searched and removed
String lineToRemove2 = ",Staff";
String currentLine;
FileReader fileReader = new FileReader(read1);
BufferedReader reader = new BufferedReader(fileReader);
BufferedWriter writer = new BufferedWriter(new FileWriter(write1));
while((currentLine = reader.readLine()) != null) {
// trim newline when comparing with lineToRemove
String trimmedLine = currentLine.trim();
//If the code finds ",Customer" it will not write it to the file thus omitting the entire line
if(trimmedLine.contains(lineToRemove1)) continue;
writer.write(currentLine + System.getProperty("line.separator"));
}
writer.close();
//Same as the above I formatted two files in this application.
fileReader = new FileReader(read2);
reader = new BufferedReader(fileReader);
writer = new BufferedWriter(new FileWriter(write2));
while((currentLine = reader.readLine()) != null) {
// trim newline when comparing with lineToRemove
String trimmedLine = currentLine.trim();
if(trimmedLine.contains(lineToRemove2)) continue;
writer.write(currentLine + System.getProperty("line.separator"));
}
writer.close();
fileReader.close();
System.out.println("Execution complete"); //If app gets to this point print to console 'Execution Complete'
} catch (IOException e) {
e.printStackTrace(); //If app fails print stack trace (Error path to console)
}
}
}--
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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/9138786c-ba33-4ce2-bfba-d5517aace6fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
That level of filtering isn't available in the API or GAM but could easily be done in a Sheet:gam print groups to driveAnd then filter to your hearts content in the Google Spreadsheet.Jay
On Wed, May 30, 2018, 8:59 AM Andrea <andrea....@consultant.solgroup.com> wrote:
Hi all.I need to list all groups that name (or description) match a string .A command like this:gam print groups where name (or description) like "RED"It's possible with GAM ?I'm not able (I'm a little goat :)Please, help me.Thank you all !!Andrea
IMPORTANT:
This is a business and not a personal e-mail, this message and its attachments are confidential and may also be legally privileged.
If you are not the intended recipient, or have received this e-mail in error, please notify immediately the sender and delete this message and all its attachments.
Any unauthorized review, copying, disclosure, dissemination, or distribution of this message and/or its attachments is strictly forbidden.--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/ca0c1f2e-66cb-4a8d-a80b-6123b7ed2270%40googlegroups.com.
--
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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/b2e0afb2-72bf-47cf-a4d7-f84de3b04085%40googlegroups.com.
I only said description as an example. But, it might be the next relevant field besides email and name?
--
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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/70ca651d-c775-4328-9feb-611a186bb8d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.