-
-
Notifications
You must be signed in to change notification settings - Fork 0
Table.NormalizeTextColumns
Rodrigo Celso de Lima Porto edited this page Jan 13, 2026
·
1 revision
This function cleans and formats text columns in a table. It removes line breaks, non-standard spaces, duplicated spaces, and applies optional casing (Proper, Lower, or Upper). You can specify which columns to process or let the function automatically detect all text columns.
Table.NormalizeTextColumns(
tbl as table,
optional columnNames as list,
optional textCasing as text
) as table-
tbl: The input table containing text columns to be cleaned and formatted. -
columnNames: (optional) A list of column names to be processed. If not provided or empty, all columns of type text or nullable text will be processed. -
textCasing: (optional) A string indicating the desired text casing format. Accepted values are:- "Proper": Capitalizes the first letter of each word.
- "Lower": Converts all texts to lowercase.
- "Upper": Converts all texts to uppercase.
- If not specified, casing is not changed.
- The function replaces line feed characters (
#(lf)) with spaces. - It removes non-breaking spaces (
Character.FromNumber(160)), trims leading/trailing spaces, and collapses multiple spaces into one. - This function is useful for preparing text data for analysis, comparison, or display.
Example 1: Clean all text columns
let
Source = #table(
{"Name", "Comment"}, {
{" JOHN DOE ", "Hello#(lf)World"},
{" jane smith", "Nice to meet you"}
}),
Result = Table.NormalizeTextColumns(Source)
in
ResultResult
| Name | Comment |
|---|---|
| JOHN DOE | Hello World |
| jane smith | Nice to meet you |
Example 2: Clean and apply Proper case to selected columns
let
Source = #table(
{"Name", "Note"}, {
{" MARIA clara", "great#(lf)job"},
{"joΓ£o SILVA", "excellent work"}
}),
Result = Table.NormalizeTextColumns(Source, {"Name", "Note"}, "Proper")
in
ResultResult
| Name | Note |
|---|---|
| Maria Clara | Great Job |
| JoΓ£o Silva | Excellent Work |
- Binary.Unzip πβοΈ
- DateTime.ToUnixTime πβοΈ
- Decision.EntropyWeights πβοΈ
- Decision.TOPSIS πβοΈ
- List.Correlation πβοΈ
- List.Intercept πβοΈ
- List.Outliers πβοΈ
- List.PopulationStdDev πβοΈ
- List.Primes πβοΈ
- List.Rank πβοΈ
- List.Slope πβοΈ
- List.Variance πβοΈ
- List.WeightedAverage πβοΈ
- Number.FromRoman πβοΈ
- Number.IsInteger πβοΈ
- Number.IsPrime πβοΈ
- Number.ToRoman πβοΈ
- Statistical.NormDist πβοΈ
- Statistical.NormInv πβοΈ
- Table.AddColumnFromList πβοΈ
- Table.CorrelationMatrix πβοΈ
- Table.NormalizeColumnNames πβοΈ
- Table.NormalizeTextColumns πβοΈ
- Table.RemoveBlankColumns πβοΈ
- Table.TransposeCorrectly πβοΈ
- Text.CountChar πβοΈ
- Text.ExtractNumbers πβοΈ
- Text.HtmlToPlainText πβοΈ
- Text.RegexExtract πβοΈ
- Text.RegexReplace πβοΈ
- Text.RegexSplit πβοΈ
- Text.RegexTest πβοΈ
- Text.RemoveAccents πβοΈ
- Text.RemoveDoubleSpaces πβοΈ
- Text.RemoveLetters πβοΈ
- Text.RemoveNumerals πβοΈ
- Text.RemovePunctuations πβοΈ
- Text.RemoveStopwords πβοΈ
- Text.RemoveWeirdChars πβοΈ
- AreArraysEquals πβοΈ
- AutoFillFormulas πβοΈ
- CleanString πβοΈ
- DisableRefreshAll πβοΈ
- EnableRefreshAll πβοΈ
- FileExists πβοΈ
- FileNameIsValid πβοΈ
- GetAllFileNames πβοΈ
- GetLetters πβοΈ
- GetMonthNumberFromName πβοΈ
- GetStringBetween πβοΈ
- GetStringWithSubstringInArray πβοΈ
- GetTableColumnNames πβοΈ
- IsAllTrue πβοΈ
- IsInArray πβοΈ
- ListObjectExists πβοΈ
- PreviousMonthNumber πβοΈ
- RangeHasAnyFormula πβοΈ
- RangeHasConstantValues πβοΈ
- RangeIsHidden πβοΈ
- RangeToHtml πβοΈ
- SendEmail πβοΈ
- SetQueryFormula πβοΈ
- StringContains πβοΈ
- StringEndsWith πβοΈ
- StringStartsWith πβοΈ
- SubstringIsInArray πβοΈ
- Summation πβοΈ
- TableHasQuery πβοΈ
- WorksheetHasListObject πβοΈ