sort -u complete_file > sorted_file_JSON.sh

This script removes most of the duplicates in the merged json files and writes them to sorted files. BUT! you have to give your merged files (with all your subcategories) specific names as you can gather from the script.