Read, replace and write json files