1

I am looking to edit JSON files in bulk / batch. I know I can do this programmatically, or do find/replaces across files, but I am hoping to find a friendlier GUI that allows me to do things across a selection of files like:

  • editing a certain key:
  • adding a key
  • nice to have: seeing stats of the value of a specific key to quickly spot typo's

Is there something available like this for any OS, or as a webapp?

To clarify what I mean, I have included two example json files below:

File 1:

{
    "title": "Some title",
    "categories": [
        "Category 1",
        "Category 2"
    ],
    "specs": [
        "Up",
        "Down",
        "Left",
        43
    ],
    "price: {
        "type": "Upper",
        "amount": 5,
    },
    "delivery: {
        "type": "Pickup",
        "amount": 1,
    },
}

File 2:

{
    "title": "Some other title",
    "categories": [
        "Category 1",
        "Catergoy 6"
    ],
    "specs": [
        "Up",
        42
    ],
    "price: {
        "type": "Upper",
        "amount": 6,
    },
    "delivery: {
        "type": "Address",
        "amount": 2,
    },
    "status": sold
}

I am looking for GUI software that would allow me to e.g.:

  • edit the price.amount key and set it to 10 for all selected files
  • add a key status to all files, choosing whether or not I want to overwrite any existing keys
  • show all values for the key category, such that I can quickly see that there are 3 distinct values of which one has a typo (Categroy 6).
1

2 Answers 2

0

Various text editors allow you to open several files at once and do find and replace over several. I use Notepad++. Your question is a little vague. Any software that would allow more then find and replace would be so complex to use that you might as well write a script for it.

Batch replace with Notepad++ is explained in this SO answer.

3
  • Thanks. Could you perhaps add how I can do the 3 things listed using find and replace? Also, what can I do to make it more concrete? Commented Jun 10, 2023 at 8:49
  • @SaaruLindestøkke what kind of editing do you need to do exaclty? editing a key probably comes done to just find and replace. if you actually want to manipulate the tree and not just add a new line at a certain position, you will need to parse the file anyway. maybe give an example file and what should be the results. Commented Jun 19, 2023 at 14:38
  • 1
    I've added an example, hope that helps clarify what I'm looking for. Commented Jun 19, 2023 at 21:58
0

Check out Kate (from KDE). The application is cross-platform and very functional. But for mass editing of JSON values, it is probably better to write a simple Python script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.