Need Help Rename, Edit, *.json File
-
Hello everyone, I have a problem and I hope that someone would or could help me out.
Example which needs to be changed:
“plugin#0” : “MacGruber.Life.13:/Custom/Scripts/MacGruber/Life/MacGruber_Life.cslist”,
“plugin#1” : “via5.Synergy.3:/Custom/Scripts/Synergy/Synergy.cslist”,
“plugin#2” : “via5.Synergy.3:/Custom/Scripts/Synergy/Synergy.cslist”,
“plugin#3” : “via5.Synergy.3:/Custom/Scripts/Synergy/Synergy.cslist”,
“plugin#4” : “AcidBubbles.Glance.20:/Custom/Scripts/AcidBubbles/Glance/Glance.cs”,
“plugin#5” : “ky1001.PresetLoader.18:/Custom/Scripts/ky1001/PresetLoader/PresetLoader.cs”
“id” : “Hunting-Succubus.Enhanced_Eyes.latest:/Custom/Clothing/Female/HUNTING-SUCCUBUS/Enhanced_Eyes/Enhanced Eyes Fantasy Stylized.vam”,
“id” : “DateKnight.satinlace_stockings.latest:/Custom/Clothing/Female/Dateknight/Dateknight-satinlace-stockings/Dateknight-satinlace-stockings.vam”,
“id” : “DateKnight.bikini_set.latest:/Custom/Clothing/Female/Dateknight/Dateknight-bikini-bottom/Dateknight-bikini-bottom.vam”,
“id” : “DateKnight.bikini_set.latest:/Custom/Clothing/Female/Dateknight/Dateknight-bikini-top/Dateknight-bikini-top.vam”,
“id” : “DateKnight.satin_chocker.latest:/Custom/Clothing/Female/Dateknight/Dateknight-satin-chocker/Dateknight-satin-chocker.vam”,
“presetName” : “bill_prime.klphgz_Normalized_Poses.latest:/Custom/Atom/Person/Pose/klphgz_Normalized/NoEXP/Standing/174”
“faceDiffuseUrl” : “RenVR.Barbie.latest:/Custom/Atom/Person/Textures/Barbie (REN)/FaceD (Pink).jpg”,
“torsoDiffuseUrl” : “RenVR.Barbie.latest:/Custom/Atom/Person/Textures/Barbie (REN)/torsoD.jpg”,
“limbsDiffuseUrl” : “RenVR.Barbie.latest:/Custom/Atom/Person/Textures/Barbie (REN)/limbsD.jpg”,
“genitalsDiffuseUrl” : “RenVR.Barbie.latest:/Custom/Atom/Person/Textures/Barbie (REN)/genitalsD.png”,
“faceNormalUrl” : “RenVR.Barbie.latest:/Custom/Atom/Person/Textures/Barbie (REN)/faceN.png”,
“torsoNormalUrl” : “RenVR.Barbie.latest:/Custom/Atom/Person/Textures/Barbie (REN)/torsoN.png”,
“genitalsSpecularUrl” : “MonsterShinkai.Ye-Jin_2.latest:/Custom/Atom/Person/Textures/MonsterShinkai/Ye-Jin/genitalsS.jpg”,
“faceGlossUrl” : “MonsterShinkai.Ye-Jin_2.latest:/Custom/Atom/Person/Textures/MonsterShinkai/Ye-Jin/Ye-Jin_faceG.jpg”,TO:
“plugin#0” : “Custom/Scripts/MacGruber/Life/MacGruber_Life.cslist”,
“plugin#1” : “Custom/Scripts/Synergy/Synergy.cslist”,
“plugin#2” : “Custom/Scripts/Synergy/Synergy.cslist”,
“plugin#3” : “Custom/Scripts/Synergy/Synergy.cslist”,
“plugin#4” : “Custom/Scripts/AcidBubbles/Glance/Glance.cs”,
“plugin#5” : “Custom/Scripts/ky1001/PresetLoader/PresetLoader.cs”
“id” : “Custom/Clothing/Female/HUNTING-SUCCUBUS/Enhanced_Eyes/Enhanced Eyes Fantasy Stylized.vam”,
“id” : “Custom/Clothing/Female/Dateknight/Dateknight-satinlace-stockings/Dateknight-satinlace-stockings.vam”,
“id” : “Custom/Clothing/Female/Dateknight/Dateknight-bikini-bottom/Dateknight-bikini-bottom.vam”,
“id” : “Custom/Clothing/Female/Dateknight/Dateknight-bikini-top/Dateknight-bikini-top.vam”,
“id” : “Custom/Clothing/Female/Dateknight/Dateknight-satin-chocker/Dateknight-satin-chocker.vam”,
“presetName” : “Custom/Atom/Person/Pose/klphgz_Normalized/NoEXP/Standing/174”
“faceDiffuseUrl” : “Custom/Atom/Person/Textures/Barbie (REN)/FaceD (Pink).jpg”,
“torsoDiffuseUrl” : “Custom/Atom/Person/Textures/Barbie (REN)/torsoD.jpg”,
“limbsDiffuseUrl” : “Custom/Atom/Person/Textures/Barbie (REN)/limbsD.jpg”,
“genitalsDiffuseUrl” : “Custom/Atom/Person/Textures/Barbie (REN)/genitalsD.png”,
“faceNormalUrl” : “Custom/Atom/Person/Textures/Barbie (REN)/faceN.png”,
“torsoNormalUrl” : “Custom/Atom/Person/Textures/Barbie (REN)/torsoN.png”,
“genitalsSpecularUrl” : “Custom/Atom/Person/Textures/MonsterShinkai/Ye-Jin/genitalsS.jpg”,
“faceGlossUrl” : “Custom/Atom/Person/Textures/MonsterShinkai/Ye-Jin/Ye-Jin_faceG.jpg”,The following simply needs to be deleted:
MacGruber.Life.13:/
via5.Synergy.3:/
AcidBubbles.Glance.20:/
ky1001.PresetLoader.18:/
Hunting-Succubus.Enhanced_Eyes.latest:/
DateKnight.satinlace_stockings.latest:/
DateKnight.bikini_set.latest:/
DateKnight.satin_chocker.latest:/
bill_prime.klphgz_Normalized_Poses.latest:/
RenVR.Barbie.latest:/
MonsterShinkai.Ye-Jin_2.latest:/
MonsterShinkai.Ye-Jin_2.latest:/I need an automatic solution for this
-
@Scuzym said in Need Help Rename, Edit, *.json File:
Hello everyone, I have a problem and I hope that someone would or could help me out.
Your example includes quotes and the posting engine alters those. Had you read the “Please Read This Before Posting” (at the start of the help wanted section) and provided the examples in a code box then I could be sure of which quotes you have.
Nonetheless I have looked at the examples and it would appear you want to remove from just after the first
:
up until the second:
. Then the quote will be added in before the remaining text. As mentioned, because the quotes cannot be verified I have included what I think you have in the replacement field. It is up to you to confirm if that character is correct, or replace with the correct one if required.The solution uses regular expressions so your search mode must be regular expression. Using the Replace function we have:
Find What:(?-s)(: ).+?:/
Replace With${1}"
Terry
-
Your example includes quotes and the posting engine alters those. Had you read the “Please Read This Before Posting” (at the start of the help wanted section) and provided the examples in a code box then I could be sure of which quotes you have.
Strongly endorse this comment.
For an in-Notepad++ solution, you might consider my JsonTools plugin, which can be used to filter JSON.
You could also write a Python script using the PythonScript plugin.
As a general rule, do not use the regex-replace in Notepad++ to edit JSON files. JSON is sufficiently syntactically complex that any regex that can handle all the corner cases would be too horrible to contemplate if not impossible.
I’ve figured out a simple regex using RemesPath (my JsonTools query language) that should get the job done:
@ = s_sub(@, g`^.+?/`, ``)
Essentially this just replaces all the values in the object with a regex-edited version of the original value, removing everything up to and including the first/
. -
Hello, @scuzym, @terry-r, @mark-olson and All,
@scuzym, why not this regex S/R ?
-
SEARCH
(?-s):\x20(.).+?/
-
REPLACE
:\x20\1
Best Regards,
guy038,
-
-
Hi folks, thank you very much for the quick help.
Tery’s solution worked right away, Thank you!
I’ll try the other suggestions at the next opportunity. Thank you all!