Hey! Im looking for a way or a software that can compare two files and find similarities between them.

Say I have two files with lists of names in them, I want to know which names are in both files.

All I have found is software that find differences, not similarities.

Thanks!

Dani AI

Generated

As asked for a way to find the names present in both files, a simple, reliable and scriptable approach is to use PowerShell's Compare-Object. It is available on modern Windows and can show the intersection (equal lines) if the inputs are normalized first (trim whitespace, ignore case, remove duplicates). Example (line-by-line lists):

$A = Get-Content 'C:\path\file1.txt' |
    ForEach-Object { $_.Trim().ToLowerInvariant() } |
    Sort-Object -Unique

$B = Get-Content 'C:\path\file2.txt' |
    ForEach-Object { $_.Trim().ToLowerInvariant() } |
    Sort-Object -Unique

Compare-Object -ReferenceObject $A -DifferenceObject $B -IncludeEqual |
    Where-Object { $_.SideIndicator -eq '==' } |
    Select-Object -ExpandProperty InputObject |
    Out-File 'C:\path\common.txt' -Encoding UTF8

For CSVs or files where names are in a column, extract that column first with Import-Csv and then compare:

$A = Import-Csv 'C:\path\file1.csv' | Select-Object -ExpandProperty NameColumn
$B = Import-Csv 'C:\path\file2.csv' | Select-Object -ExpandProperty NameColumn

Compare-Object $A $B -IncludeEqual |
    Where-Object { $_.SideIndicator -eq '==' } |
    Select-Object -ExpandProperty InputObject

When lists are very large, building a .NET hash set from the smaller file and streaming the larger file through it is much faster and uses less memory:

$hash = New-Object 'System.Collections.Generic.HashSet[string]'
Get-Content 'C:\path\file1.txt' | ForEach-Object { $hash.Add($_.Trim().ToLowerInvariant()) | Out-Null }

Get-Content 'C:\path\file2.txt' |
    ForEach-Object { $s = $_.Trim().ToLowerInvariant(); if ($hash.Contains($s)) { $s } } |
    Sort-Object -Unique |
    Out-File 'C:\path\common.txt'

For those preferring GUIs, tools such as WinMerge (free) or Beyond Compare (paid) can also highlight identical lines and export matches. Normalize input (trim/case) or extract the relevant column first to avoid false negatives. PowerShell's Compare-Object docs: Compare-Object (Microsoft.PowerShell.Utility). Notes: raised cost as a factor; mentioned third‑party utilities — the PowerShell approach is free, scriptable, and good for automation.

Are you looking for freeware? I know only one software which does what you want, but it's not free....

I actually need it for works so as long as its not crazy expensive it would be fine.

I had used an application which compares two file and find the matching file withint your HDD. Are you looking for such application which shows you the similar files in you HDD? If yes then this is one application that I came across "DizzyDiff".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.