Quick way to do a 'smart' find and replace to update my YAML for the MQTT breaking change?

I’m looking at having to do this 130 times, it won’t take me ages, but I remain surprised in a way there isn’t a script that you can toss your configuration.yaml into…

I need to (for every MQTT sensor)

replace
- platform: "mqtt"
with whatever the
- name: "sensor name" is

anyone know if there’s a quick way to do this?!

Thanks

That would depend on which editor you are using. VSCode for example supports regex in its find and replace function.

Keep in mind you also need to move all this configuration from under sensor: (or from its !include file) to under mqtt:

Thanks. Not using VSCode. I guess I’d need to read some tutorial or other to check it’s within the scope of my abilities. (I know what needs doing manually and in the end that’s how I did it last night, only took a few minutes in the end, just faffy)