# Extract the output to excel files

**URL:** <https://forum.ansible.com/t/extract-the-output-to-excel-files/29562>\
**Category:** Ansible Project\
**Created:** [January 29, 2019, 2:21pm UTC](https://forum.ansible.com/t/extract-the-output-to-excel-files/29562 "2019-01-29T14:21:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kefi\_Ammar](https://avatars.discourse-cdn.com/v4/letter/k/b487fb/32.png) [@Kefi\_Ammar](https://forum.ansible.com/u/Kefi_Ammar)\
**Post date:** [January 29, 2019, 2:21pm UTC](https://forum.ansible.com/t/extract-the-output-to-excel-files/29562/1 "2019-01-29T14:21:05Z")

</div>

Hello everyone,

I am new to Ansible and I am using it for network operations. So, I am extracting informations from network devices (software versions, platforms, hostnames, interfaces, system infos,…) and they are presented in a messy way that makes it hard to read or organise especially for an important number of devices.

I am asking if there is modules or something that Ansible can do to extract these informations to an excel file or maybe in a .csv file that can be structured. Anyone has an experience with the management and health check of network devices (Cisco and Juniper) using Ansible could help me out.

I am using Ansible 2.7.5

Thank you.

Best regards,  
Ammar

---

<div class="post-metadata">

**Author:** ![sajal\_tiwari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sajal_tiwari/32/2755_2.png) [@sajal\_tiwari](https://forum.ansible.com/u/sajal_tiwari)\
**Post date:** [January 29, 2019, 3:57pm UTC](https://forum.ansible.com/t/extract-the-output-to-excel-files/29562/2 "2019-01-29T15:57:48Z")

</div>

You can check Napalm ansible module for extracting information mentioned by you.

---

<div class="post-metadata">

**Author:** ![Diptajeet\_Khan](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@Diptajeet\_Khan](https://forum.ansible.com/u/Diptajeet_Khan)\
**Post date:** [January 30, 2019, 2:02am UTC](https://forum.ansible.com/t/extract-the-output-to-excel-files/29562/3 "2019-01-30T02:02:47Z")

</div>

Hi Kefi,

Ansible I believe natively doesn’t support write back to Excel. You can use some python scripts to write back facts/results from ansible to excel though. Actually that’s what I am also doing with Cisco Nexus devices.

About Napalm, need to explore if it really can write back to excel.

BR

---

<div class="post-metadata">

**Author:** ![Bikram](https://avatars.discourse-cdn.com/v4/letter/b/f04885/32.png) [@Bikram](https://forum.ansible.com/u/Bikram)\
**Post date:** [January 30, 2019, 5:36am UTC](https://forum.ansible.com/t/extract-the-output-to-excel-files/29562/4 "2019-01-30T05:36:21Z")

</div>

Hi Kefi,

You can do something like this. echo your result and redirect the result to a csv. Later open with excel.

- name: Output Information to CSV file

shell: echo {{inventory\_hostname}}, {{ difference\_7010.stdout }}\>\> mismatched\_qos.csv

delegate\_to: localhost

Thanks.

Bikram

---

<div class="post-metadata">

**Author:** ![Kefi\_Ammar](https://avatars.discourse-cdn.com/v4/letter/k/b487fb/32.png) [@Kefi\_Ammar](https://forum.ansible.com/u/Kefi_Ammar)\
**Post date:** [January 30, 2019, 3:11pm UTC](https://forum.ansible.com/t/extract-the-output-to-excel-files/29562/5 "2019-01-30T15:11:35Z")

</div>

Hello everyone,

I’ve already tried to extract in csv then opened it with excel but I did not really like the output, I think it needs some more “polishing”.

Now I’m exploring napalm hopefully to get a good and readable results with it.

Thanks  
Ammar
