Skip to content

keev-studio/Deduplicate-json-objects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deduplicate Objects from JSON

Deduplicate Objects from JSON Logo

Visual Studio Marketplace Version Visual Studio Marketplace Downloads License

📋 Overview

A Visual Studio Code extension that helps you clean up JSON files by removing duplicate objects based on a specified field.

💡 Perfect for cleaning up data exports, API responses, or any JSON array that might contain duplicates.

✨ Features

  • ✅ Removes duplicate objects from JSON array files
  • 🔍 Lets you choose which property to use for comparison
  • 🔄 Works with any property in your JSON objects
  • 📝 Preserves the first occurrence of each unique object
  • 📊 Shows summary of deduplication results

🚀 How to Use

  1. Open a JSON file containing an array of objects
  2. Right-click in the editor
  3. Select "Deduplicate Objects from JSON" from the context menu
  4. When prompted, select the property to use for deduplication (e.g., ID, name, etc.)
  5. The extension will remove all duplicates based on the selected property, keeping only the first occurrence

📝 Example

Click to expand example

Before:

[
  {
    "id": 793,
    "quoteText": "Fortune favours the brave.",
    "quoteAuthor": "Virgil"
  },
  {
    "id": 794,
    "quoteText": "Fortune favours the brave.",
    "quoteAuthor": "Julius Caesar"
  },
  {
    "id": 795,
    "quoteText": "Keep building!",
    "quoteAuthor": "Bob the Builder"
  }
]

After (when deduplicating by "quoteText"):

[
  {
    "id": 793,
    "quoteText": "Fortune favours the brave.",
    "quoteAuthor": "Virgil"
  },
  {
    "id": 795,
    "quoteText": "Keep building!",
    "quoteAuthor": "Bob the Builder"
  }
]

⚙️ Requirements: Visual Studio Code 1.60.0 or higher

🔧 Extension Settings: This extension does not add any VS Code settings.

⚠️ Known Issues: Works only with JSON files that contain arrays of objects at the root level

📝 Release Notes: 1.0.0 Initial release of Deduplicate Objects from JSON

👨‍💻 About the Author: Created ❤️ by Keev Studio

📄 License: MIT

About

VS Code extension to remove duplicate objects from JSON files

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors