# Ansible trigering Python Code to Merge CSV's into Excel

**URL:** <https://forum.ansible.com/t/ansible-trigering-python-code-to-merge-csvs-into-excel/37390>\
**Category:** Ansible Project\
**Created:** [November 28, 2022, 11:46am UTC](https://forum.ansible.com/t/ansible-trigering-python-code-to-merge-csvs-into-excel/37390 "2022-11-28T11:46:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameume](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rameume](https://forum.ansible.com/u/rameume)\
**Post date:** [November 28, 2022, 11:46am UTC](https://forum.ansible.com/t/ansible-trigering-python-code-to-merge-csvs-into-excel/37390/1 "2022-11-28T11:46:51Z")

</div>

is it possible to run python code (from ansible) to combine two csv files (generated by ansible) in to excel sheet and make ansible to send that excel file via email

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [November 28, 2022, 11:51am UTC](https://forum.ansible.com/t/ansible-trigering-python-code-to-merge-csvs-into-excel/37390/2 "2022-11-28T11:51:56Z")

</div>

Yes. Or at least I don’t see why this would NOT be possible.

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [November 28, 2022, 11:54am UTC](https://forum.ansible.com/t/ansible-trigering-python-code-to-merge-csvs-into-excel/37390/3 "2022-11-28T11:54:13Z")

</div>

Yes. Ansible has a shell module and a command module. Both can be used to run any command including a python script. Read about them both in ansible documentation to make sure you understand their differences.

Walter

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [November 28, 2022, 2:09pm UTC](https://forum.ansible.com/t/ansible-trigering-python-code-to-merge-csvs-into-excel/37390/4 "2022-11-28T14:09:52Z")

</div>

And if you are really game one can develop their own modules using Python. They have their own helper functions to do this to make it feel and look like a native task
