Skip to content

Commit 9254e74

Browse files
committed
Update 2024-10 - Auto trim column names for whitespace -- InspectWhitespace and FormatShowControlSymbosl.pq
1 parent 5598bf2 commit 9254e74

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

forumQuestions/pq/2024-10 - Auto trim column names for whitespace -- InspectWhitespace and FormatShowControlSymbosl.pq

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,19 @@ let
3434
is 0-127 in decimal
3535
or 0x0-0x7f in hexadecimal
3636
*/
37-
3837
/*
39-
input: text with whitespace
40-
output: text with whitespace visualized
38+
input: text with whitespace
39+
output: text with whitespace, visualized. Non-whitespace characters are preserved.
4140
Techincally this isn't codepoints, so it's not perfect, but works for all of ascii
4241

4342
probably poor performance
43+
44+
example:
45+
in: " User#(cr,lf) Names"
46+
out: "␠␠User␍␊␠Names"
47+
48+
in: "#(0020) Zero-Width #(200d) Joiner Inside",
49+
out: "␠␠Zero-Width␠<ZWJ>␠Joiner␠Inside"
4450
*/
4551
Text.FormatControlSymbols = (string as text) as text =>
4652
let
@@ -64,7 +70,7 @@ let
6470

6571
raw_names = Table.ColumnNames( Source ),
6672
raw_names_extra = {
67-
" User(cr,lf) Names",
73+
" User#(cr,lf) Names",
6874
" Has#(tab) tabs ",
6975
"#(0020) Zero-Width #(200d) Joiner Inside",
7076
Character.FromNumber(0x1b),

0 commit comments

Comments
 (0)