# String manipulation ansible.

**URL:** <https://forum.ansible.com/t/string-manipulation-ansible/17802>\
**Category:** Ansible Project\
**Created:** [March 20, 2015, 11:22pm UTC](https://forum.ansible.com/t/string-manipulation-ansible/17802 "2015-03-20T23:22:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antoine\_Voiry](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Antoine\_Voiry](https://forum.ansible.com/u/Antoine_Voiry)\
**Post date:** [March 20, 2015, 11:22pm UTC](https://forum.ansible.com/t/string-manipulation-ansible/17802/1 "2015-03-20T23:22:04Z")

</div>

Hello,  
I would like to change a file based on the lower case of a variable.  
How do I do that?  
I tried

- name: replace string in file

replace: dest=‘{{base\_dir}}/{{lower(attribute\_name)}}.file.properties’ regexp=‘CHANGEME’ replace=‘{{ ansible\_fqdn }}’ backup=yes

I thought I would be able to do it as in Jinja but that doesn’t work.  
Any idea?  
Antoine

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 20, 2015, 11:25pm UTC](https://forum.ansible.com/t/string-manipulation-ansible/17802/2 "2015-03-20T23:25:48Z")

</div>

try {{attribute\_name|lower}
