If the files are small-ish and you don't care too much about performance, then the following would be a trivial way:
$data = Import-Csv file1 $vips = Import-Csv file2 $data = $data | ?{ $vips -notcontains $_.Initials } $data | Export-Csv file1_new -NoTypeInformation
A faster way would be to add the names to remove to a set, but given the things you're talking about here I doubt you'll get into the range of a few thousand or million users.
Read full article from Powershell csv remove lines - Stack Overflow
No comments:
Post a Comment