how can I split composed words into single words?

tazarbm

Elite Member
Executive VIP
Jr. VIP
Joined
Oct 28, 2020
Messages
11,663
Reaction score
14,636
Hi,

as the title says, I want to split composed words into their constituent parts (with space between the words), like for example...

RedDragon --> Red Dragon
MultipleChoices --> Multiple Choices
etc...

Pretty self explanatory :)

I did look for online solutions but I'm either too stupid and can't figure out how to use them (highly unlikely so please don't call me stupid, only I am allowed to call myself that :p ), or those online sites are stupid themselves (you can call them stupid if you want, I'm sure they won't mind) and don't understand what I'm trying to do, because they don't split anything, the output they give me is either the same as the input, or they split the words by character (ie. they space out each character, like so: R e d D r a g o n) which is so idiotic...

Does anyone have a solution to this seemingly simple problem?

If I didn't have to split 1000+ words I would do it manually, but I'm not doing it manually for 1000 words.

Thanks in advance to anyone who's willing to help!
 
I know you love AIs, so I'd just paste the word list on chatgpt, gemini, etc and ask them to split the composed words into single words, they will mostly do the job, you will need to manually review and fix some words, but in general it will work
 
I know you love AIs,
:mad::mad:

so I'd just paste the word list on chatgpt, gemini, etc and ask them to split the composed words into single words, they will mostly do the job, you will need to manually review and fix some words, but in general it will work
that's precisely what I won't do.

But thanks for the tip, I'm waiting for normal solutions :)
 
Are they all LikeThis?

You could do a formula for adding a space before the second capital letter

Python:
import re

words = ["RedDragon", "MultipleChoices", "XMLParser", "ThisIsFun"]
split_words = [re.sub(r'([a-z])([A-Z])', r'\1 \2', w) for w in words]

for original, split in zip(words, split_words):
    print(f"{original} --> {split}")

Code:
=TRIM(ARRAYFORMULA(REGEXREPLACE(A1,"([a-z])([A-Z])","$1 $2")))
 
Are they all LikeThis?

You could do a formula for adding a space before the second capital letter

Python:
import re

words = ["RedDragon", "MultipleChoices", "XMLParser", "ThisIsFun"]
split_words = [re.sub(r'([a-z])([A-Z])', r'\1 \2', w) for w in words]

for original, split in zip(words, split_words):
    print(f"{original} --> {split}")

Code:
=TRIM(ARRAYFORMULA(REGEXREPLACE(A1,"([a-z])([A-Z])","$1 $2")))
yeah, each word is capitalized...

I don't know what to do with the Python formula, but the TRIM code I added into LibreCalc but it returns "#NAME?" error. And yes, I did replace A1 with the corresponding cell...
 
yeah, each word is capitalized...

I don't know what to do with the Python formula, but the TRIM code I added into LibreCalc but it returns "#NAME?" error. And yes, I did replace A1 with the corresponding cell...
Ahh those were for excel

try for librecalc

=REGEX(A1;"([a-z])([A-Z])";"$1 $2")

The best way to do this accurately for a large list is usually with a custom script. A good script would check against a dictionary of common words to find the correct break points. For example, if it sees 'RedDragon', it would check if 'Red' is a word, then 'Dragon' is a word.
is that a threat
 
Ahh those were for excel

try for librecalc

=REGEX(A1;"([a-z])([A-Z])";"$1 $2")
duuuude! It WORKS :D

You're a genius, and I owe you a bear... when / if we ever meet drinks are on me :)

yep, it does work but I'm not using google products for my keyword research. Maybe it's 100% safe and I'm just paranoid, but it's still google, so...

But anyway, it's solved now... still courtesy of @CPANathan , of course :)

Thanks guys, you're all awesome!
 
Hey, since we're at it (and since this comes so easy for you), might I become cheeky and ask for one more formula? :p

More specifically, I would like to get a count of all of the letters of the 2 words combined (so, for Red Dragon this would be 9 letters, for Multiple Choices it would be 15 letters, etc...)

Only if possible, of course! If not possible, no problem, I still appreciate your help :)
 
@tazarbm A count formula is in order

Nah nah, AI'ed it; len for length

so your output column you'd look for the =len(cell)

so it'd be a

i'll get back to you

throw this at the column equal to your split words

=LEN(SUBSTITUTE(B1;" ";""))
 
duuuude! It WORKS :D

You're a genius, and I owe you a bear... when / if we ever meet drinks are on me :)
Everyone hire @CPANathan the man knows how to get things done! :)

Nice dude you treaded regex, where few dare to go.... lol
 
Everyone hire @CPANathan the man knows how to get things done! :)

Nice dude you treaded regex, where few dare to go.... lol
Man I'd say if we looked into my profile posts from a year to 3 years ago today

we'd all be angry with me for the reasons I beat Regex into my brain

I remember telling my little brother(a computer systems nerd) about Regex, and he came back to me after his second(?) year in college like "so regex, we look into that now do we"

@Panther28 AI advice too

@tazarbm excuse my English mate, I get excited

correction: "where your split words are output you can target with this formula:

=LEN(SUBSTITUTE(B1;" ";""))"
 
I keep thinking sheets, sorry;
can just AI formulas from different softwares to find middleground

=LEN(SUBSTITUTE(B2;" ";""))

How do I get access to that tool you're using? I can imagine that going well for my shenanigans
 
=LEN(SUBSTITUTE(B2;" ";""))
well, it worked :)

2.png

How do I get access to that tool you're using? I can imagine that going well for my shenanigans
You mean this Excel-like program?? It's Linux' version of MS Office, except that it's free, just like Linux itself :)

I keep thinking sheets, sorry;
all good :)

can just AI formulas from different softwares to find middleground
I don't like the idea of AI in my life to begin with, I definitely wouldn't want these retarded machines to learn to synchronize "their" knowledge, so let's keep them dumb and useless :D
 
well, it worked :)

View attachment 479730


You mean this Excel-like program?? It's Linux' version of MS Office, except that it's free, just like Linux itself :)


all good :)


I don't like the idea of AI in my life to begin with, I definitely wouldn't want these retarded machines to learn to synchronize "their" knowledge, so let's keep them dumb and useless :D
Hahahahahaha I was looking for something to drop on my newly configured WSL installation

You're a beast
 
Hi,

as the title says, I want to split composed words into their constituent parts (with space between the words), like for example...

RedDragon --> Red Dragon
MultipleChoices --> Multiple Choices
etc...

Pretty self explanatory :)

I did look for online solutions but I'm either too stupid and can't figure out how to use them (highly unlikely so please don't call me stupid, only I am allowed to call myself that :p ), or those online sites are stupid themselves (you can call them stupid if you want, I'm sure they won't mind) and don't understand what I'm trying to do, because they don't split anything, the output they give me is either the same as the input, or they split the words by character (ie. they space out each character, like so: R e d D r a g o n) which is so idiotic...

Does anyone have a solution to this seemingly simple problem?

If I didn't have to split 1000+ words I would do it manually, but I'm not doing it manually for 1000 words.

Thanks in advance to anyone who's willing to help!
You can quickly fix that by using a regex find and replacing `([a-z])([A-Z])` with `$1 $2` in any spreadsheet or text editor. This will automatically change RedDragon to Red Dragon
 
Back
Top