Skip to content

lsa-mis/LSA-Spreadsheet-Matcher

Repository files navigation

LSA Spreadsheet Matcher

A client-side web application that compares two spreadsheets, matches rows by a primary key, and exports a categorized Excel report with three sheets: Only in File A, In Both, and Only in File B. Runs entirely in the browser—no backend required.

Tech Stack

  • React (Vite)
  • TailwindCSS for styling
  • Lucide React for icons
  • SheetJS (xlsx) for reading/writing Excel/CSV files

Features

  • Upload Zone: Two file dropzones (File A and File B) accepting .csv, .xlsx, and .xls
  • Primary Key Selector: Choose a matching column from shared headers between both files
  • Data Cleaning Options:
    • Ignore capitalization (case-insensitive) — default: on
    • Trim extra spaces — default: on
    • Ignore rows with empty primary keys — default: on
  • Merge Conflict Strategy: When a row exists in both files with different values:
    • Keep File A's values
    • Keep File B's values
    • Combine values (File A | File B)
  • Results Dashboard: Summary cards with totals for each category
  • Export: Download a single Excel workbook with three sheets:
    1. Only in [File A Name]
    2. In Both
    3. Only in [File B Name]

Each sheet includes metadata columns: Source Status and Match Key Used.

Run Locally

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:5173 in your browser.

Build for Production

npm run build

Output is in the dist/ folder. Serve with any static file server.

Project Structure

src/
├── App.jsx                 # Main app, state management
├── components/
│   ├── FileDropzone.jsx    # File upload with drag & drop
│   ├── ConfigurationPanel.jsx  # Primary key, toggles, merge strategy
│   └── ResultsDashboard.jsx     # Stats cards + export button
├── utils/
│   ├── parsers.js          # SheetJS parsing for CSV/Excel
│   ├── compareEngine.js    # Comparison & merge logic
│   └── exportExcel.js      # Excel workbook generation
├── index.css
└── main.jsx

How It Works

  1. Parse & Clean: Both files are parsed. Data cleaning options are applied to the primary key column.
  2. Deduplication: Each file is deduplicated by primary key (first occurrence kept).
  3. Comparison:
    • Only in File A: Keys in A but not B
    • In Both: Keys in both; merge conflict strategy applied for differing columns
    • Only in File B: Keys in B but not A
  4. Column Union: Output uses all columns from both files; missing columns are left blank.

About

Compare two spreadsheets, match rows by a primary key, and export a categorized Excel report with three sheets: Only in File A, In Both, and Only in File B. Runs entirely in the browser—no backend required.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors