Author Posts

May 19, 2017 at 3:12 pm

Hi,
I have two text files with values in it as below;
File A
hello
superman
spiderman

File B
batman
coolguy
spiderman
When I use command compare-object $A $B I get below result, please help as I need each word to be compared but here it takes file A words as whole line and gives result as 'Hello Superman spiderman' =>

May 19, 2017 at 5:24 pm

Possibly a problem with the line break characters although I can't replicate it. How was the text file generated and how are you getting the files in $a and $b? Get-Content?

May 22, 2017 at 9:53 am

Hi Matt,
Yes, I use get-content to get $A and $B. The compare works when I run command in below format 🙁
compare-object $(get-content C:\Temp\Ref.txt) $(get-content C:\Temp\Des.txt) -IncludeEqual

Thanks,
Kishor