# how to replace windows style line endings with linux in the replace task?

**URL:** <https://forum.ansible.com/t/how-to-replace-windows-style-line-endings-with-linux-in-the-replace-task/20891>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 16, 2016, 5:09pm UTC](https://forum.ansible.com/t/how-to-replace-windows-style-line-endings-with-linux-in-the-replace-task/20891 "2016-03-16T17:09:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_Kone](https://avatars.discourse-cdn.com/v4/letter/v/4da419/32.png) [@Vikram\_Kone](https://forum.ansible.com/u/Vikram_Kone)\
**Post date:** [March 16, 2016, 5:09pm UTC](https://forum.ansible.com/t/how-to-replace-windows-style-line-endings-with-linux-in-the-replace-task/20891/1 "2016-03-16T17:09:52Z")

</div>

I tried this, but doesnt seem to work

```auto
- name: Fix line endings from CRLF to LF
  local_action: replace dest={{my_dir}}/conf/{{item}} regexp='\r\n' replace='\n'

```

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [March 16, 2016, 6:12pm UTC](https://forum.ansible.com/t/how-to-replace-windows-style-line-endings-with-linux-in-the-replace-task/20891/2 "2016-03-16T18:12:13Z")

</div>

Hi,
