# Creating variables from register variable in ansible

**URL:** <https://forum.ansible.com/t/creating-variables-from-register-variable-in-ansible/32293>\
**Category:** Ansible Project\
**Created:** [February 21, 2020, 11:35am UTC](https://forum.ansible.com/t/creating-variables-from-register-variable-in-ansible/32293 "2020-02-21T11:35:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sivaraman\_P](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sivaraman\_P](https://forum.ansible.com/u/Sivaraman_P)\
**Post date:** [February 21, 2020, 11:35am UTC](https://forum.ansible.com/t/creating-variables-from-register-variable-in-ansible/32293/1 "2020-02-21T11:35:40Z")

</div>

I have the register variable which contains number of lines in stdout\_lines. With those lines I have to create variables. Is there any workaround for this.

Ex: register: output

output.stdout\_line contains below lines

variable1: value1;

variable2: variable1 + value2;

variable3: variable2 + value3;

.

.

.

.

n number of lines (change based on the output);

I Need to create variables with name variable1 and assign value1 to it and create variable with name variable2 and assign created variable1’s value + value 2 to it and so on upto n number of lines.
