• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Split Text at Each occurrence of Capital Letter in Power Query 2013

MBS

Member
Hi all,
I want to split the word, say "ExcelPowerQuery" at each occurrence of capital letter, as "Excel", "Power" and "Query" in separate columns.

But I have Excel 2013 power query , where I dont found option "By Lower Case to Upper Case", under split column section.

So how I can do this by using User Interface of M function.

Thanks
 
= Table.SplitColumn(Source, "Column1", Splitter.SplitTextByCharacterTransition({"a".."z"}, {"A".."Z"}), {"Column1.1", "Column1.2", "Column1.3"})
 
In case that splitter function is not available in the version 2013, one can get creative with list functions:

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Separate_words = Table.AddColumn(Source, "Separate words", each Text.Trim(Text.Combine(List.Transform(Text.ToList([Column1]), each if List.Count(List.Intersect({{_},{"A".."Z"}})) = 1 then " " & _ else _ ), ""))),
    Cols_2_create = List.Max(List.Transform(Separate_words[Separate words], each List.Count(Text.Split(_, " ")))),
    Split_by_space = Table.SplitColumn(Separate_words, "Separate words", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv),Cols_2_create)
in
    Split_by_space
81584
 
  • Like
Reactions: MBS
I have a column called "Text". I want to split text based on each capital letter. So if my text was "Hello World", I would get two columns, "H" and "e". If my text was "hello world", I would get three columns, "h", "e", and "l". How do I achieve this?
Thanks!

A:

You could use Split function.
In your case, something like this should work:
SPLIT(TEXT(), CHAR(65))
 
Hi Musupothers,
Welcome to the forum. Do note we have some rules here we all follow. One of them is to not hijack a thread started by some-one else. Do post your question in a new thread.
 
Back
Top