Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Merge two csv's around a shared column containing unique values.
- $csv1 = Import-Csv -Path D:\test1.csv
- $csv2 = Import-Csv -Path D:\test2.csv
- $csv2 | ForEach-Object {
- $status = $_.Status
- $emailkey = $_.Email
- $csv1 | Where-Object {$_.Email -eq $emailkey} |
- Select-Object Users, Email, Group, App, @{n='Status';e={ $status }}}|
- Export-Csv -NoTypeInformation -Path D:\workingmerge.csv
Advertisement
Add Comment
Please, Sign In to add comment