Hi
I want to change
ConstantWord-20200207-CarBusTrain
ConstantWord-20200324-ApplesOrangesBananasMangosPearsPeanutsCapsicums
into
ConstantWord-20200207-Car Bus Train
ConstantWord-20200324-Apples Oranges Bananas Mangos Pears Peanuts Capsicums
i.e.
I want to add a space before every capital letter after the 23rd character.
(which is equivalent to)
I want to add a space before the second and every subsequent capital letter after the date.
--
that is, generically,
from:
ConstantWord-yyyymmdd-VariablewordoneVariablewordtwoVariablewordthreeVariablewordfourVariablewordfive
into:
ConstantWord-yyyymmdd-Variablewordone Variablewordtwo Variablewordthree Variablewordfour Variablewordfive
Where
ConstantWord is the same alphastring in every file. The first and eigth characters are always capitals
yyyymmdd is the date in numerics and is different in every file
and
Variablewordone etc are all alpha characters, the words are all different from each other and different in every file and always start with a Capital letter. There is a different number of Variablewords in each file, but there are usually 6 to 12 of them
--
I have got this far
Find: (ConstantWord-[0-9].*?-)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?)([A-Z])(.*?) etc
Replace: \1-\2-\3 \5\6 \7\8 \9\10
(where ([A-Z])(.*?) successfully matches a word that starts with a Capitalletter)
...but this is no good as
1) BRU has a maximum of 9 terms for resorting in Regex and there are often more than 9 terms in the file
2)It only matches when there are the same number of Variablewords in the filename as there is in the Findterm. I want it to work whatever the number of Variablewords
is there another way to do it?
I don't particularly want to change ConstantWord into Constant Word, but if it makes life easier, I can do so, then manually change it back with a regular search and replace, as it is always the same string.
Same goes for -Variablewordone (I don't particularly want to change it to - Variablewordone, but can do, if necessary)
thanks