# how to skip a line in a file

**URL:** <https://forum.ansible.com/t/how-to-skip-a-line-in-a-file/29773>\
**Category:** Ansible Project\
**Created:** [February 26, 2019, 10:53am UTC](https://forum.ansible.com/t/how-to-skip-a-line-in-a-file/29773 "2019-02-26T10:53:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [February 26, 2019, 10:53am UTC](https://forum.ansible.com/t/how-to-skip-a-line-in-a-file/29773/1 "2019-02-26T10:53:05Z")

</div>

Hy all,

I have a file called “file1.csv”, the contents of this file is:

word1 word2 word3 word4

I want him to jump in line with every word, i want this result :

word1  
word2  
word3  
word4

I use this task for test but she replace every space by \n :

{{ lookup(‘file’ , ‘/home/my\_user/file1.csv’) | replace(’ ’ , ‘\n’) }}

Someone have an idea please ??!!

Thank you very much guy !! 🙂

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [February 26, 2019, 11:00am UTC](https://forum.ansible.com/t/how-to-skip-a-line-in-a-file/29773/2 "2019-02-26T11:00:30Z")

</div>

Use regex\_replace instead of replace with the good regex (you need to use python regex)

Regards,

JYL

---

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [February 26, 2019, 12:03pm UTC](https://forum.ansible.com/t/how-to-skip-a-line-in-a-file/29773/3 "2019-02-26T12:03:56Z")

</div>

Thank you very much, regex\_replace works perfect !!

You are very strong Jean-Yves !! 🙂

regards
