you can do this easily using sed on a linux environment
just need to write a bash script to find and replace these lines