Compares two CSV or JSON datasets by a key field and reports what was added, removed, and changed.
src/FileDiff.Core: diff algorithm and CSV/JSON readers, no dependency on the CLIsrc/FileDiff.Cli: thin command-line wrappertests/FileDiff.Core.Tests: xUnit tests for the diff logic
Both files are read into a common representation: a record is a key plus a set of field values, regardless of format. The old set is loaded into a dictionary by key. Each new record is looked up in it. No match means added. A match with different field values means changed. Everything left in the dictionary after that is removed.
dotnet build
dotnet test
FileDiff.Cli <oldFile> <newFile> --key <keyField>
Example:
FileDiff.Cli old.csv new.csv --key Id
Format is picked by file extension (.csv or .json), so old and new files don't have to use the same format. Output lists added and removed record keys. For changed records it shows which fields differ and their old/new values. Unchanged records are not shown.