格式化CSV的输出

格式化CSV的输出

问题描述:

Hello Everyone,

Hello Everyone,

请执行格式化我在两个CSV之间执行差异后得到的输出。

Kindly help me out in Formatting my output that I get after performing the Difference between the two CSV's.

下面是两个CSV:

First.csv

来自,主题,已收到

测试邮件程序,测试邮件以检查ITSD - 复制规则,2015年9月13日

Test Mailer,Test mail to check the ITSD - Copy rule,9/13/2015

测试邮件程序,测试邮件2, 2015年9月13日

Test Mailer,Test mail 2,9/13/2015

Desiree,SAP数据不正确,2015年9月13日

Desiree,SAP incorrect data,9/13/2015

Huang,BizTalk Issue,2015年9月13日

Huang,BizTalk Issue,9/13/2015

测试邮件程序,测试邮件以检查ITSD-R10101092 - 复制规则,2015年9月13日

Test Mailer,Test mail to check the ITSD-R10101092 - Copy rule,9/13/2015

测试邮件程序,测试邮件2-I10101092,9 / 13/2015

Test Mailer,Test mail 2-I10101092,9/13/2015

我需要执行两个CSV之间的差异:

I need to perform the difference between the two CSV's :

$first=import-csv D:\first.csv
$second=Import-Csv D:\second.csv
$diff= Diff $second $first $diff|where{$_.sideindicator -eq '=>'}|select 'InputObject'|export-Csv D:\out.csv -NoTypeInformation


输出如下所示:



out.csv

" InputObject"

The Output looks like below :

out.csv

"InputObject"

" @ {From = Test Mailer; Subject =测试邮件以检查ITSD -Copyrule; Received = 9/13/2015

"@{From=Test Mailer; Subject=Test mail to check the ITSD -Copyrule;Received=9/13/2015

}"

" @ {Similarily其他输出..}"

"@{Similarily other outputs..}"

理想的输出格式应该是:

Desirable Output Format Should be :

来自,主题,收到

测试邮件程序,测试邮件以检查ITSD -Copyrule,2015年9月13日

Test Mailer,Test mail to check the ITSD -Copyrule,9/13/2015

help Compare-Object -Parameter Property