Advanced(?) column splitting

Juan Sombrero

New Member
Joined
Nov 7, 2013
Messages
14
Hi all,

I have a text column with variable length and want to split is into the last character and the "rest" (this rest is of variable length). It's easy to extract the last character, but then the original table will remain and I still don't have my "rest".

Anybody a tip on how to do this?

Thx in advance,
Juan
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
This is one way:
let
Source = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"A", type text}}),
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "A", "B"),
#"Extracted First Characters" = Table.TransformColumns(#"Duplicated Column", {{"A", each Text.Start(Text.From(_, "de-DE"), Text.Length(_)-1), type text}}),
#"Extracted Last Characters" = Table.TransformColumns(#"Extracted First Characters", {{"B", each Text.End(Text.From(_, "de-DE"), 1), type text}})
in
#"Extracted Last Characters"

Duplicating you column and then taking the first x first & only the last one from the second column.
 
Upvote 0
Hi Juan :-)
You can do that almost directly from UI with this step
SplitCol = Table.SplitColumn(#"Changed Type","A",Splitter.SplitTextByPositions({0, 1}, true),{"A", "B"})

The red part you have to put manually because UI delivers {"A.1", "A.2"}
Of course Imke's way is also good :-))

Regards
 
Upvote 0

Forum statistics

Threads
1,224,120
Messages
6,176,494
Members
452,733
Latest member
Gao87

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