格式化CSV的输出 [英] Format the Output of CSV

查看:133
本文介绍了格式化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 





这篇关于格式化CSV的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆