Author Posts

August 20, 2013 at 7:44 am

Hi, I have a files lines of file names, like:

file1.txt
File2.txt
FILE3.txt
FILE4.TXT

I run a commnad below:

cat \\share\file.txt | where { $_.ToUpper().Split(".")[0] -ne $_.Split(".")[0] }

But, it does not result with expected result, that is:

file1.txt
File2.txt

Why? Can someone help me?

Regards

August 20, 2013 at 7:46 am

PowerShell is case-insensitive on string comparisons. Use -cne instead of -ne.

August 20, 2013 at 8:03 am

Hi Don,

Thank you so much, it works very nice.

Regards