mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-15 15:53:32 +00:00
Add example of Merge-WorkShett
This commit is contained in:
19
Examples/MergeWorkSheet/MergeCSV.ps1
Normal file
19
Examples/MergeWorkSheet/MergeCSV.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$xlFile = "$env:TEMP\mw.xlsx"
|
||||
|
||||
Remove-Item $xlFile -ErrorAction Ignore
|
||||
|
||||
$leftCsv = @"
|
||||
MyProp1,MyProp2,Length
|
||||
a,b,10
|
||||
c,d,20
|
||||
"@ | ConvertFrom-Csv
|
||||
|
||||
$rightCsv = @"
|
||||
MyProp1,MyProp2,Length
|
||||
a,b,10
|
||||
c,d,21
|
||||
"@ | ConvertFrom-Csv
|
||||
|
||||
Merge-Worksheet -OutputFile $xlFile -ReferenceObject $leftCsv -DifferenceObject $rightCsv -Key Length -Show
|
||||
Reference in New Issue
Block a user