开发者

merge two .csv files into one file

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜