Questions tagged [compareobject]

Usually refers to object comparison in object oriented languages.

Typical cases compare:

  • Ojects values.
  • Object references.
  • Object types.
99 questions
1
vote
2 answers

In PowerShell how to display filename in the output of compare-object

I am very new to PowerShell scripting. I have two folders with hundreds of files with the same name in both folders. I am writing a long script to compare all the files and send output to a text file. When I use this script: compare-object …
AnR
  • 1,809
  • 3
  • 26
  • 45
1
vote
2 answers

How to compare CSV file in powershell but exclude some fields of the dataset within the compare

I'm looking for a way to compare two CSV files with powershell and output only the data sets from the first given CSV file which are different. It should also be possible to exclude some fields of the data set (provided via the header field name of…
Nico Grüner
  • 39
  • 1
  • 4
1
vote
2 answers

Java compare object element and if "name" attribute is same print it once

Is it possible to compare attributes of objects in a list & if the attribute "name" happens to be the same then print out the one that is older (with the rest that does not have same name) and if their name & age happens to be the same then print…
ZedORYasuo
  • 183
  • 7
1
vote
1 answer

How can I access my custom side indicators in Compare-Object in powershell?

I am comparing two xml files that contain a record of directories and files that we want to update to be the same. I have custom messages that replace the "=>" and "<=" side indicators but in the file I export the object to I cannot see the messages…
jakebake
  • 91
  • 7
1
vote
2 answers

Find what is different in two very large lists

I have two lists about 1k people each list. What I want to do is find who is leftover between the two. $BunchoEmail = Import-Csv C:\temp\Directory.csv | Select-Object primaryEmail -ExpandProperty primaryEmail $GoogleUsers = gam print users fields…
dcaz
  • 847
  • 6
  • 15
1
vote
1 answer

Modifying Compare-Object Output file content

I am comparing two text files and sending the difference to an output file. Here is my simple code. $file1 = (Get-Content .\txt1.txt) $file2 = (Get-Content .\txt2.txt) compare-object $file1 $file2 | out-file txt3.txt (Get-Content -Path .\txt3.txt)…