Utilities, Tools to use on editing jsons
Posted: Sat Sep 01, 2018 10:56 pm
i am writing this because idk what untilities are u using currently and i have some nice ones that might help you (for PC)
0. To edit json files or any textfile on PC use TextPad (it is free), it will not ruin any formatting. An phone i used Total commander and its own file editor.
1. If you want to edit multiple jsons at once (eg. adding a category to them) use Notepad ++ you can edit any number of files at once. also mentioned here /viewtopic.php?f=17&t=4422&p=43674&hilit=notepad
also see Edit multiple jsons - regex section below in APPENDIX
2. compare two jsons (to see thechanges) use Total commander it has: Files/Compare By Content option
3. compare many file contents eg. 2 complete asset folders (to see all changes betw. 2 asset folder versions) - use Total commander it has: Commands/Synchronize Dirs option, very good in comparing complete directories and the file contents! (this is the one i use when i receive an asset folder so i quickly see all changes in all files - and i approve them individually - eg. when i have newer version of something )
4. Simply editing jsons: i use TextPad
5. Multi update filenames!: Total Commander there is a multi-file-rename-tool! i was able to rename all _und_ to _undead_ in one click! did u know that?
APPENDIX
Edit multiple jsons - regex
Using notepad ++ you can edit multiple files.
But good news not only by search relpace normal strings but complex expressions.
You can learn and try all your expressions here easily: https://regex101.com/
examples i used:
1. My goal was to replace the trnBestAgainstMeWater strings to something else, and this regex will find all possible formats and i can replace those too (no matter how many spaces, whitespaces, newline characters are in it alsmost anywhere)
here important regex letters:
means any number of whitespace/newline characters
the [character needs escaping with \
2. use this to find files that has a specific trn bestagainstme category in it
3.if you want to find all files with the specific category in it.
4. i wanted to remove empty trnCanNotCarryMe TAGs regardless of any spaces or newline characters
5. we cleared more unused attributes (handles only one-liners)
0. To edit json files or any textfile on PC use TextPad (it is free), it will not ruin any formatting. An phone i used Total commander and its own file editor.
1. If you want to edit multiple jsons at once (eg. adding a category to them) use Notepad ++ you can edit any number of files at once. also mentioned here /viewtopic.php?f=17&t=4422&p=43674&hilit=notepad
also see Edit multiple jsons - regex section below in APPENDIX
2. compare two jsons (to see thechanges) use Total commander it has: Files/Compare By Content option
3. compare many file contents eg. 2 complete asset folders (to see all changes betw. 2 asset folder versions) - use Total commander it has: Commands/Synchronize Dirs option, very good in comparing complete directories and the file contents! (this is the one i use when i receive an asset folder so i quickly see all changes in all files - and i approve them individually - eg. when i have newer version of something )
4. Simply editing jsons: i use TextPad
5. Multi update filenames!: Total Commander there is a multi-file-rename-tool! i was able to rename all _und_ to _undead_ in one click! did u know that?
APPENDIX
Edit multiple jsons - regex
Using notepad ++ you can edit multiple files.
But good news not only by search relpace normal strings but complex expressions.
You can learn and try all your expressions here easily: https://regex101.com/
examples i used:
1. My goal was to replace the trnBestAgainstMeWater strings to something else, and this regex will find all possible formats and i can replace those too (no matter how many spaces, whitespaces, newline characters are in it alsmost anywhere)
Code: Select all
"trnBestAgainstMeWater"\s*:\s*{\s*"categories"\s*:\s*\[\s*"U_SHIPS"\s*\]\s*}Code: Select all
\s*Code: Select all
\[2. use this to find files that has a specific trn bestagainstme category in it
Code: Select all
"trnBestAgainstMe(Water|Ground)":{"categories":\[[\s\w",]*"U_ANTI_MOUNTED"[\s\w",]*\]Code: Select all
"trnCategories":\[[\s\w",]*"U_ANTI_MOUNTED"[\s\w",]*\]Code: Select all
"trnCanNotCarryMe":{\s*},Code: Select all
[ \t]+"grantorShopItems"\s*:\s*[^\n]*\n
[ \t]+"trnRequires"\s*:\s*[^\n]*\n
[ \t]+"trnUpgradeAncestor"\s*:\s*[^\n]*\n
[ \t]+"trnRevokerTechs"\s*:\s*[^\n]*\n
[ \t]+"isFactoryThatNotAffectsFactoryLimits"\s*:\s*[^\n]*\n
[ \t]+"isOccupiableBuilding"\s*:\s*[^\n]*\n
[ \t]+"isStealthUnit"\s*:\s*[^\n]*\n