I have two .csv files that I want to combine into one.
FileA has headers of DisplayName and Email FileB has header of Owners. I have not been able to merge the two as one. Any help is appreciated.The new file needs to have the headers as:
DisplayName Email 开发者_开发技巧 Owners
AccountA AccountA@company.com John.doe@company.com
This is one way of doing it:
$filea = import-csv filea.csv
$fileb = import-csv fileb.csv
for($i=0;$i -lt $filea.count;$i++){
$filea[$i] | Add-Member -MemberType NoteProperty -Name Owners -Value $fileb[$i].Owners
}
$filea | export-csv combined.csv -notype
精彩评论