# read a file .CSV from ansible

**URL:** <https://forum.ansible.com/t/read-a-file-csv-from-ansible/21260>\
**Category:** Ansible Project\
**Created:** [April 25, 2016, 2:22pm UTC](https://forum.ansible.com/t/read-a-file-csv-from-ansible/21260 "2016-04-25T14:22:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imed\_khaskhoussi](https://avatars.discourse-cdn.com/v4/letter/i/919ad9/32.png) [@imed\_khaskhoussi](https://forum.ansible.com/u/imed_khaskhoussi)\
**Post date:** [April 25, 2016, 2:22pm UTC](https://forum.ansible.com/t/read-a-file-csv-from-ansible/21260/1 "2016-04-25T14:22:17Z")

</div>

hello , i need to read some value from a .CSV file with ; separator  
for example : param1;value1  
param2;value2  
i want to write them in a file using ansible like this : param1=value1  
param2=value2

thank you in advance .

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 25, 2016, 2:51pm UTC](https://forum.ansible.com/t/read-a-file-csv-from-ansible/21260/2 "2016-04-25T14:51:12Z")

</div>

How about the csv lookup plugin?

[http://docs.ansible.com/ansible/playbooks\_lookups.html#the-csv-file-lookup](http://docs.ansible.com/ansible/playbooks_lookups.html#the-csv-file-lookup)

You can write content to a file by registering a variable and then using the content argument with the copy module.

Hope this helps,

Jon
