I have some JSON data in a file like this:
<code> "editRate" : 44100,
"trackRect" : [0, 0, 0, 0],
</code>
<code> "editRate" : 44100,
"trackRect" : [0, 0, 0, 0],
</code>
"editRate" : 44100,
"trackRect" : [0, 0, 0, 0],
After I edit this using JSON and dump it, the format changes:
<code> "editRate": 60,
"trackRect": [
0,
0,
3840,
2160
],
</code>
<code> "editRate": 60,
"trackRect": [
0,
0,
3840,
2160
],
</code>
"editRate": 60,
"trackRect": [
0,
0,
3840,
2160
],
Also I am getting space instead of tabs after attributes:
<code>"version": "7.0",
</code>
<code>"version": "7.0",
</code>
"version": "7.0",
vs
<code>"version" : "7.0",
output_filename = os.path.join(folder_path, f'{base_name}_gen.proj')
with open(output_filename, 'w') as outfile:
json.dump(data, outfile, indent=4)
</code>
<code>"version" : "7.0",
output_filename = os.path.join(folder_path, f'{base_name}_gen.proj')
with open(output_filename, 'w') as outfile:
json.dump(data, outfile, indent=4)
</code>
"version" : "7.0",
output_filename = os.path.join(folder_path, f'{base_name}_gen.proj')
with open(output_filename, 'w') as outfile:
json.dump(data, outfile, indent=4)
Is it possible to preserve these? Because I need to match the same file and compare it using a merge tool so that I can see if it matches 100%. Right now I get a lot of changes everywhere due to these changes and also makes it hard to compare the values.