Import groups
From MoodleDocs
Groups import provides a simple, easy way to create groups from a spreadsheet (CSV).
The CSV file has just one required field (groupname), but can include others.
A sample file looks like this:
groupname, description, enrolmentkey Team 1, Group Assignment Team 1, orange Team 2, Group Assignment Team 2, purple Team 3, Group Assignment Team 3, green
Note that it doesn't currently handle anything to do with Groupings.