Skip to content

feat(cli): Add diff command (compare workbooks) #137

Closed

Description

@arcaputo3

Summary

Add a command to compare two Excel workbooks and show differences.

Syntax

# Compare entire workbooks
xl diff old.xlsx new.xlsx

# Compare specific sheet
xl diff old.xlsx new.xlsx --sheet Sheet1

# Compare specific range
xl diff old.xlsx new.xlsx --sheet Sheet1 --range A1:F100

# Output format
xl diff old.xlsx new.xlsx --format json

Output Example

Comparing old.xlsx vs new.xlsx

Sheet: Sheet1
  Changed cells:
    A5: "Revenue" -> "Total Revenue"
    B5: 1000 -> 1500
    C5: =SUM(C2:C4) -> =SUM(C2:C4)*1.1
  
  Added cells:
    D5: "New Column"
  
  Deleted cells:
    E5: (was "Old Column")

Summary:
  - 3 cells changed
  - 1 cell added
  - 1 cell deleted

Comparison Types

  • Values: Compare displayed values
  • Formulas: Compare formula expressions
  • Styles: Compare cell formatting
  • Structure: Compare sheets, rows, columns

Implementation Notes

  • Load both workbooks
  • Iterate cells, compare values/formulas
  • Track additions, deletions, changes
  • Consider: ignore whitespace, case-insensitive

Acceptance Criteria

  • Cell value comparison works
  • Formula comparison works
  • Added/deleted cells detected
  • Cross-sheet differences shown
  • JSON output format available

Priority

Low - Nice-to-have for auditing

Milestone

v0.8.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststretch0.10.0 stretch — pull in if time permits

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions