Open list of .json files, find and replace multiple different keywords in each file, and resave all files while keeping the original filenames

  Kiến thức lập trình

I am having trouble creating a python script to read through a list of many .JSON files (100+), find and replace multiple different keywords in each file, and save all files while keeping the original filenames.

The keywords which need to be found and replaced in each file are:

  1. find what: n (the string value “n” is present in the files instead of a return line)
    replace with: (an actual return line that n should produce)

  2. find what:
    replace with: (a blank – no string value here)

  3. find what: “[
    replace with: (a blank- no string value here)

  4. find what: “]
    replace with: (a blank – no string value here)

Any help would be greatly appreciated!

I’ve tried looking for similar scenarios but am unable to find anything.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT