# print the register output with proper format on the screen

**URL:** <https://forum.ansible.com/t/print-the-register-output-with-proper-format-on-the-screen/37318>\
**Category:** Ansible Project\
**Created:** [November 8, 2022, 6:12pm UTC](https://forum.ansible.com/t/print-the-register-output-with-proper-format-on-the-screen/37318 "2022-11-08T18:12:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veera](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/veera/32/4107_2.png) [@Veera](https://forum.ansible.com/u/Veera)\
**Post date:** [November 8, 2022, 6:12pm UTC](https://forum.ansible.com/t/print-the-register-output-with-proper-format-on-the-screen/37318/1 "2022-11-08T18:12:16Z")

</div>

Hi everyone ,

I am trying to print 2 files in my ansible server itself, which are already copied from other servers , which means the filenames have hostnames and date within it.

- name: compare the output files  
local\_action: command /usr/bin/sdiff “{{ logs\_dir }}”/{{ inventory\_hostname }}-Precheck-{{ ansible\_date\_time.date }}.txt “{{ logs\_dir }}”/{{ inventory\_hostname }}-Postcheck-{{ansible\_date\_time.date }}.txt  
register: result

- debug:  
var: result.output

I am able to print the output I expected …but it collapses than expected.  
Is there a way to Print them as like as in a linux bash " # diff file1 file2 "

redirecting the output to a file and printing is also helping
