# delete last blank line in the file

**URL:** <https://forum.ansible.com/t/delete-last-blank-line-in-the-file/21928>\
**Category:** Ansible Project\
**Created:** [July 5, 2016, 8:25pm UTC](https://forum.ansible.com/t/delete-last-blank-line-in-the-file/21928 "2016-07-05T20:25:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John.1209](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@John.1209](https://forum.ansible.com/u/John.1209)\
**Post date:** [July 5, 2016, 8:25pm UTC](https://forum.ansible.com/t/delete-last-blank-line-in-the-file/21928/1 "2016-07-05T20:25:24Z")

</div>

Can someone suggest an ansible regex that deletes the last blank line in a file, if it is blank.

TIA
