Replies: 1 comment 3 replies
-
hmm, been a while since i looked at that off the top of my head, a post process could further summarize and create that. You'd have to do the coding Could you post the xlsx and short script that does the compare? Do you have access to AI? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Let's say that I have 2 Excel files that I want to compare. I do not focus on specific columns, rather I'd like to get a report of which row and column that has changed, and the "before" and "after" values.
I can do as such:
$differences = Compare-WorkSheet -ReferenceFile $file1 -DifferenceFile $file2 -WorkSheetName $worksheetName $differences
which will produce the output
`_Side : =>
_File : 2.xlsx
_Sheet : Sheet1
_Row : 8
Region : South
State : Kansas
Units : 214
Price : 992.47
_Side : <=
_File : 1.xlsx
_Sheet : Sheet1
_Row : 8
Region : South
State : Kansas
Units : 214
Price : 992.48
_Side : =>
_File : 2.xlsx
_Sheet : Sheet1
_Row : 10
Region : South
State : Delaware
Units : 712
Price : 508.55
_Side : <=
_File : 1.xlsx
_Sheet : Sheet1
_Row : 10
Region : South
State : Delaware
Units : 713
Price : 508.55`
In the $differences object I can see which rows that are affected, and I can see the values of all columns, even if they aren't affected.
But, How can I use this to generate a difference report? I've tried to use Compare-Object, but with no luck.
What I want to produce is the following type of report:
`
Row: 8
Column: Price
Value before: 992.47
Value after: 992.48
Row: 10
Column: Units
Value before: 712
Value after: 713
`
I know that all the data is there, it's rather my limited PowerShell knowledge that is the problem here. I also know that I can markup the difference with BackgroundColor and FontColor, but that isn't what I'm after.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions