I have written a python script which remove's special characters (*/§) from a JSON file and then put into another folder without changing name.
Here is code:
import json
with open('ORIGINAL PATH WHERE JSON FILE IS STORED’, encoding='utf-8-sig') as json_file: FILE-NAME = json.load(json_file)
import re
Open = re.sub('[*//$§%!]', '', str(Open))
with open('ORIGINAL PATH WHERE JSON FILE IS STORED’, 'w') as f:
json.dump(FILE-NAME, f, ensure_ascii=False)
import shutil, sys
shutil.move("ORIGINAL PATH WHERE JSON FILE IS STORED", "'NEW PATH WHERE YOU WANT TO STORE JSON FILE")
It is working fine for a single JSON file. My problem is, I have more than 1000 JSON files in a folder, I want to remove special characters (*/ § $) from all the files without changing name of JSON files.