Overwriting Family Subcategories

Hi Pros,

I am trying to standardize subcategory naming conventions.
Up to now, I’ve been doing that manually but this time, I really want to get below code going so that I can automate it.
I got the existing (disorganized) subcategories of multiple families out to Excel.
Within, Excel, I managed to standardize it.
Now, I am at the final stage of overwriting the subcategory names BUT I am stuck because Clockwork’s “Subcategory.ByName” does not overwrite. Instead, it creates new ones.
Below is where I got stuck. I wanted the door subcategory name to have "Test - " in the front just to make sure it’s working. The result came out to be creating the new ones instead of replacing. The old ones had "ARCH - " as a prefix.

Please help if you know the answers to this.

Thanks again!

Last I knew renaming subcategories wasn’t possible via the API. They may have changed that but it was a no-go for me before.

I believe that you can create the new ones and reassign content from the old subcategory to the new one though. Deleting the old ones may also be possible (if they aren’t built in ones) but I haven’t tried.

Thanks for the input!
Happy 4th of July!