For a shell script used to automatically generate c++ code files, I have to split certain names apart for them to be formatted. I split them at a capital letter, but I do not want to split if there are multiple capital letters in sequence. For example:
I want this (and I get this):
ChanNameWordWrapMode -> Chan Name Word Wrap Mode
I want this:
ChanNameVAlign -> Chan Name VAlign
OSDSettings -> OSD Settings
But I get this:
ChanNameVAlign -> Chan Name V Align
OSDSettings -> O S D Settings.
The command I am using right now is:
`echo $string | sed 's/\([A-Z]\)/ \1/g' | sed 's/^ *//;s/ *$//'`
Can someone help with a sed command that does what I am asking? Thanks.