> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ntop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to combine scalar lists together as text

## Objective:

Learn how to combine scalar lists as text. In this example, we are creating a Custom Block to combine the Points and Vectors from a Displacement Point Map as well as the Von Mises stress values. The result combines the Points, Vectors, and Scalar values into a text file.

## Applies to:

* Exporting
* Simulation
* Lists

## Procedure:

#### **Create the Custom Block**

**1. Set up the inputs**

Decide what inputs are necessary for your custom block. In this example, we want a Point, a Vector, and a Scalar value.

* Add a **Point** block.
* The format of this block has its own line for each X, Y, Z. In order to easily enter the list values into this block, we want it to be in a different format, where the X, Y, Z are all in one line. To do this:
  * Right-click on the block and select 'Make model input' or just drag the block into the Input section to turn the **Point** block into an Input
  * Drag the block body back into the Notebook (this turns the variable in the Input section into the proper format)
  * Delete the **Point** block in the Notebook and keep the **Point** block Input
* Repeat this process for the **Vector** block
* Add a **Scalar** variable and move it into the Input section

![Creating the input variables for the custom block.](https://files.learn.ntop.com/help-articles/user-interface/1500013889022.png)

**2. Convert the values to Text**

Next, we need to convert the values from Scalar to Text. It's easiest to do this while we create a **Text List** at the same time.

* Add a **Text** **List** block
  * Insert a **Text from Scalar** block into the input

**Value:** Now we need to link each of our inputs into a **Text from Scalar** block using the Value inputs. Since we are linking Points and Vectors, we need a [Text from Scalar](https://support.ntopology.com/hc/en-us/articles/360058140834) block for every unique X, Y, Z value.

* Link the Point X property to the Value input
  * Open up the Point input Properties and drag the 'X' chip into the Value input

**Reference:** This input is used to maintain a consistent output. If you are exporting in units of millimeters, then a value of 1 mm would be entered into this value.

* Set the Reference to 1 mm

**Precision:** The number of significant digits for formatting the values as text.

* Set the Precision to 1

![A Text from Scalar block inside a Text List block. This is the general structure for converting the Scalar values to text that will be repeated below.](https://files.learn.ntop.com/help-articles/user-interface/1500013898762.png)

* Select the '+' icon to add another list input on the Text List block
* Repeat the process of adding the **Text from Scalar** block and linking it to the next input until all inputs are linked to the **Text List** block
  * For the Vector variables, set the Reference to 1 mm and keep the Precision at the default 17
  * For the Scalar variable, set the Reference to 1 Pa and keep the Precision at the default 17

![The completed Text List containing 7 Text from Scalar blocks. Each block converts a different simulation result scalar value into text.](https://files.learn.ntop.com/help-articles/user-interface/1500014174061.png)

**3. Concatenate the Text List**

* Add a **Concatenate Text** block
  * Insert the **Text List** from Step 2
  * Set a Delimiter (this character will be what separates the values)

![Using a Concatenate Text block to combine the Text List.](https://files.learn.ntop.com/help-articles/user-interface/1500014177001.png)

* Drag the **Concatenate Text** block into the Notebook Output

**4. Save the Custom block**

Remember the Custom Block has the same name as the Notebook Name. Due to this, we recommend naming the block the same as the Notebook Name.

#### **Combine and Export the Values**

**1.** Open an existing file or build up a new one where you want to export the values. We are using [this file](https://ntopology.app.box.com/s/9iyzgrxtqclqsu4ls6bjesqvje863us6) from a previous [Static Analysis](https://support.ntopology.com/hc/en-us/articles/360054149874) example.

**2.** **Import the Custom block**

* Select the '+' symbol in the Notebook and Import the Custom block we just created (this automatically adds the block to the Notebook)

**3. Input the values**

The example file used doesn't have the Displacement Point Map created yet. Add a **Displacement Point Map** block and input the **Static Analysis** block

* Open up the properties of the **Displacement Point Map** block and drag the Points chip into the Point input of the Custom Block
* Open up the properties of the **Displacement Point Map** block and drag the Values chip into the Vector input of the Custom Block
* Open up the properties of the **Von Mises Point Map** block and drag the Values chip into the Von Mises input of the Custom Block

![A gif demonstrating the use of the created Concatenate Results custom block. The points and values lists are drag and dropped from a Displacement Point Map into their respective variables. The values list from a Von Mises Stress point Map are added to the Von Mises input.](https://files.learn.ntop.com/help-articles/user-interface/1500013932082.png)

4. Concatenate Text List

* Add a **Concatenate Text** block
  * Change the Overload to 'Text List, Text'
  * Set the Delimiter to a unique character that is different from the first delimiter. This character separates the group of values at each point. If this was a CSV file, this value would be a line break.
  * Insert the Custom Block into the Text input (it may be slow depending on how many values are being concatenated)

**5. Export the values**

* Add an **Export Text** block
  * Insert the **Concatenate Text** block from Step 4 and choose a directory to save the file

![A concatenate text block is then used to combine the Concatenate Results custom block list. The concatenate text is then used as the Text input for the Export Text block with a specified file path.](https://files.learn.ntop.com/help-articles/user-interface/1500013933362.png)

And that's it! You've successfully combined a list of scalar values into a text file.

Are you still having issues? Contact the [support team](https://support.ntopology.com/hc/en-us/requests/new), and we'll be happy to help!

## Download the Example file:

* [Custom block](https://files.learn.ntop.com/Support%20Article%20Example%20Files/Knowledge%20Base/User%20Interface/Combine%20Scalar%20Lists%20to%20Text.ntop)

## Keywords:

*simulation list map lists results combine csv point scalar vector how-to exporting values text concatenate*
