Importing a Cubase .midiremote script with mismatching port names

A solution that worked for me to solve problems when importing Cubase .midiremote files with mismatching port names.