regex – Set string from another file as variable in Powershell


I have this text file contains the following line

group1,name1
group2,name2
group3,name3

How do I iterate the value of those string in a powershell script to print match string? If manually assign variable I will do it something like this

get-content data.csv -ReadCount 1000 | foreach { $_ -match "group1" } | Out-File name1.txt -encoding Utf8