> For the complete documentation index, see [llms.txt](https://docs.onum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onum.com/pipelines/actions/transformation/field-transformation/field-transformation-operations/text-sample-adding/pad-lines.md).

# Pad lines

## Description

This operation allows you to add padding characters to the beginning or end of each line of text. This operation is useful for formatting text, aligning data, or preparing output for specific requirements such as indentation or prefixing/suffixing lines.

***

## Data types

These are the input/output expected data types for this operation:

### Input data

`String` - Input text to be padded. The operation processes multiline text where each line is treated as a separate unit.

### Output data <a href="#output-data" id="output-data"></a>

`String` - Each line in the input will be padded based on the selected options.

***

## Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a <mark style="color:red;">**\***</mark>):

<details>

<summary>Pad position<mark style="color:red;"><strong>*</strong></mark></summary>

Determines where the padding is applied to each line of text. This parameter allows for flexible control over how padding is added, enabling you to customize the output to meet specific formatting requirements. Enter one of the following:

* **Start** - Applies the padding at the right of the strings.
* **End** - Applies the padding at the left of the strings.

</details>

<details>

<summary>Pad length<mark style="color:red;"><strong>*</strong></mark></summary>

Enter the total number of characters you want your padding to have in each line. Padding will be filled with the characters set in the **Characters** parameter until reaching the required length.

</details>

<details>

<summary>Characters</summary>

This allows you to specify which character(s) will be used for padding. This is the string that will be added to the beginning or end of each line to achieve the desired padding effect, as defined by the **Pad position** and **Pad length** parameters.

</details>

***

## Example

Suppose you want to add **padding** to a series of events:

1. In your Pipeline, open the required [Action](https://onum.gitbook.io/onum-docs/the-workspace/pipelines/actions) configuration and select the input **Field**.
2. In the **Operation** field, choose **Pad lines**.
3. Set **Pad position** to `Start`.
4. Set **Pad length** to `7`.
5. Set **Characters** to `>>>`
6. Give your **Output field** a name and click **Save**. The strings in your input field will be modified with the specified padding.

For example, the following lines:

```
Apple
Banana
Cherry
```

will be transformed into:

```json
>>> >>>Apple
>>> >>>Banana
>>> >>>Cherry
```

{% hint style="info" %}
You can try out operations with specific values using the **Input** field above the operation. You can enter the value in the example above and check the result in the **Output** field.
{% endhint %}
