Hello, @ozzy-neil, @Ekopalypse, @alan-kilborn and All,
From that link, below, giving the general structure of the JSON language :
https://www.json.org/json-en.html
Here is a work-around, using a regex S/R :
First, at the
very end of your
JSON file,
add this new
JSON object, below :
{
"Steven Kourepenos": "Mark Skaife",
"Jeff Rubin": "Russell Ingall",
"Jaime Baker": "Craig Lowndes",
}
Note that the different couples Old names: New names, added, are not necessarily, listed in the same order than in the file itself. Luckily, it does not matter ;-))
Now, open the Replace dialog ( Ctrl + H )
SEARCH (?-s)("driverName":\x20)(".+?")(?=(?s:.+)^\2\h*:\h*(".+"))|(?s)\{[^{}]+\}\Z
REPLACE \1\3
Tick the Match case option, if necessary
Tick the Wrap around option
Select the Regular expression search mode
Click once on the Replace All button ( or several times on the Replace button )
So, assuming the original JSON test, with the new object containing all the couples of names, at the very end :
{
"drivers": [
{
"driverName": "Jaime Baker",
"carDesign": "21,fa7fed,000000,ffffff,fa7fed",
"carNumber": "1",
"suitDesign": "1,fa7fed,000000,ffffff",
"helmetDesign": "1,fa7fed,000000,ffffff",
"carPath": "mx5\mx52016",
},
{
"driverName": "Steven Kourepenos",
"carDesign": "0,111111,cccccc,ed1c24",
"carNumber": "2",
"suitDesign": "13,111111,cccccc,ed1c24",
"helmetDesign": "63,111111,cccccc,ed1c24",
"carPath": "mx5\mx52016",
},
{
"driverName": "Jeff Rubin",
"carDesign": "9,ffffff,1a4b9b,dff000",
"carNumber": "3",
"suitDesign": "23,ffffff,1a4b9b,dff000",
"helmetDesign": "35,ffffff,1a4b9b,dff000",
"carPath": "mx5\mx52016",
},
...
...
...
...
...
{
"Steven Kourepenos": "Mark Skaife",
"Jeff Rubin": "Russell Ingall",
"Jaime Baker": "Craig Lowndes",
}
After clicking on the Replace All button, you should get the expected file :
{
"drivers": [
{
"driverName": "Craig Lowndes",
"carDesign": "21,fa7fed,000000,ffffff,fa7fed",
"carNumber": "1",
"suitDesign": "1,fa7fed,000000,ffffff",
"helmetDesign": "1,fa7fed,000000,ffffff",
"carPath": "mx5\mx52016",
},
{
"driverName": "Mark Skaife",
"carDesign": "0,111111,cccccc,ed1c24",
"carNumber": "2",
"suitDesign": "13,111111,cccccc,ed1c24",
"helmetDesign": "63,111111,cccccc,ed1c24",
"carPath": "mx5\mx52016",
},
{
"driverName": "Russell Ingall",
"carDesign": "9,ffffff,1a4b9b,dff000",
"carNumber": "3",
"suitDesign": "23,ffffff,1a4b9b,dff000",
"helmetDesign": "35,ffffff,1a4b9b,dff000",
"carPath": "mx5\mx52016",
},
...
...
...
...
...
If this S/R does the job, I’ll tell you, next time, how this regular expression works… !
Best Regards,
guy038