Yes! A few people have mentioned that there are better approaches but it’s not obvious. What you described is clearly the better way to do this type of find and replace, yet when you google “find and replace within a file”, it’s not easy to find this approach.