@Fawkes your regex doesn't do anything to identify even or odd numbers, do you still need help with this?
basically never use sed -i twice on the same file, you can usually refactor to a single sed script and run multiple actions on the filei want to update the existing file not create a new file