Skip to main content

Pad

Pad a string to a fixed length.

Pad a string to a fixed length

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column.string, array, nullnullNo
Options
sideSide from which to fill resulting string.string—Yes
skip_emptyIf true, skip padding for empty or whitespace-only values.booleanfalseNo
Formatting
pad_lengthLength for the output.integer—Yes
charThe character to pad the input with.string—Yes
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No

Examples​

wrangles:
- format.pad:
input: Part Number
pad_length: 5
side: left
char: "-"
Part Number
0458
396
84
98516
Part Number
-0458
--396
---84
98516
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID32
Catalog keyformat.pad
Recipe keyformat.pad
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceformat
Documentation groupformat
AliasesNone
Runtime symbolwrangles.recipe_wrangles.format.pad
Legacy UUID76c19378-38f4-45aa-85d1-3cdf8f8aae29

Sources