If you already have the csv then import/set to $users and you could run something like using the AzureAD module ( or set to Get-DistributionGroupMember using Exo Powershell)
$report = Foreach ($user in $users) {
$groups = $user | Get-AzureADUserMembership
# create output objects with username and groups:
Foreach ($group in $groups) {
[PSCustomObject][ordered]@{
UserDisplayName = $user.DisplayName
UserPrincipalName = $user.UserPrincipalName
GroupDisplayName = $group.DisplayName
}}}
$report | export-csv groups.csv -NoTypeInformation