# 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

![](/files/SQ9k5y99hrpQppBSKJOF) - 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>

![](/files/OqZOURzyWzbgIRI5oux3) - 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/pipelines/actions/transformation/field-transformation/field-transformation-operations/text-sample-adding/pad-lines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
