forked from itsnotaboutthecell/powerquerym
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplitTextByCharacterPosition.pq
More file actions
30 lines (27 loc) · 941 Bytes
/
SplitTextByCharacterPosition.pq
File metadata and controls
30 lines (27 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
Created By: Alex Powers
Website: http://www.itsnotaboutthecell.com
LinkedIn: https://www.linkedin.com/in/alexmpowers/
Contact: alexmpowers@itsnotaboutthecell.com
*/
let
Source = #table(
type table [CustomerID = Int64.Type, CustomerName = text, CustomerCity = text, CustomerState = text],
{
{1, "Bob Smith", "Rockford", "IL"},
{2, "Randy Savage", "St Louis", "MO"},
{3, "Lucy Davis", "Lansing", "MI"}
}
),
/*
Splits Column Header Characters When Transitioning
From Lower Case to Upper Case to a list of Values
Wrapped in a Text Combine to Combine all List Values to a Scalar Text Value
*/
SplitByCharacter = Table.TransformColumnNames(Source, each
Text.Combine(
Splitter.SplitTextByCharacterTransition({"a".."z"}, {"A".."Z"})(_)
, " ")
)
in
SplitByCharacter