Power Query - split to columns by capital letter

pepe74287

New Member
Joined
Feb 4, 2015
Messages
43
Hello,

Another question related to Column split. This time I would need to split data into 2 columns, where delimiter is last capital letter.

For instance:

Robert DuvallCrime
TabuDrama

Should be splitted as:

Column1Column2
Robert DuvallCrime
TabuDrama

Thanks
Pepe
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try this code below
Code:
let
    source = Table.FromColumns({ {"Robert DuvallCrime", "TabuDrama"} }, {"text"}),
    AddCol = Table.AddColumn(source, "Custom", each Record.FromList(Splitter.SplitTextByPositions({0,Text.PositionOfAny([text], {"A".."Z"}, 1)}) ([text]), {"Column1", "Column2"})),
    ExpandRecordColumn = Table.ExpandRecordColumn(AddCol, "Custom", {"Column1", "Column2"}, {"Column1", "Column2"}),
    RemoveCol = Table.RemoveColumns(ExpandRecordColumn,{"text"})
in
    RemoveCol

Regards
 
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,856
Members
449,411
Latest member
adunn_23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top