Well, here is my novice question of the day for you. I am trying to compare and remove the differences between 2 columns on 2 different worksheets in the same workbook. Here is the kicker. I need to only compare the first 4 characters to determine if the line should be removed. The (mostly unlogical) reason for this is that one sheet has project names in the format 0000 XXXXXXXXX. The other sheet has project names that may have a format of 0000_XXXXX (underscore) or 0000 - XXXXX (hyphen). However, the project number 0000 is unique and will not have a duplicate on the same worksheet.
I run the below script to get a basic kick out and the format is AFU. It will list the projects multiple times in the sheet. Any assistance will be greatly appreciated.
Compare-Worksheet 'C:ClosedProjectsclosed.xlsx' 'C:ClosedProjectsclosed.xlsx' -WorksheetName 'Projects','ClosedProjects' -IncludeEqual | Export-Excel C:ClosedProjectsdiff.xlsx
question from:
https://stackoverflow.com/questions/66054300/compare-excel-worksheets-in-powershell 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…