Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Powershell compare two CSV files, how do you make it case-insensitive?

I have two CSV files I am comparing, one has two columns, the second file has three. I am needing the output of all three columns from the input from the first CSV file.

The code I am currently using is as follows

$ErrStatus = Import-Csv .\StatusErrorResults.csv

$StatLibrary = Import-Csv .\Status_Library.csv

Compare-Object $StatLibrary $ErrStatus -Property Device,Status -IncludeEqual -ExcludeDifferent -PassThru | Select-Object \* -ExcludeProperty SideIndicator | Export-Csv -NoTypeInformation .\StatusErrorResultsFiltered.csv"

It is ignoring a section of the Status Library due to case sensitivity, how can I include regardless of case?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Compare-Object is case-insensitive by default, but you have -CaseSensitive switch to change that.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading