Pad
Pad a string to a fixed length.
Pad a string to a fixed length
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | Name of the input column. | string, integer, array | — | Yes |
output | Name of the output column. | string, array, null | null | No |
| Options | ||||
side | Side from which to fill resulting string. | string | — | Yes |
skip_empty | If true, skip padding for empty or whitespace-only values. | boolean | false | No |
| Formatting | ||||
pad_length | Length for the output. | integer | — | Yes |
char | The character to pad the input with. | string | — | Yes |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values 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
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 32 |
| Catalog key | format.pad |
| Recipe key | format.pad |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | format |
| Documentation group | format |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.format.pad |
| Legacy UUID | 76c19378-38f4-45aa-85d1-3cdf8f8aae29 |
Sources