# How to delete a duplicate in file ?

**URL:** <https://forum.ansible.com/t/how-to-delete-a-duplicate-in-file/29774>\
**Category:** Ansible Project\
**Created:** [February 26, 2019, 12:23pm UTC](https://forum.ansible.com/t/how-to-delete-a-duplicate-in-file/29774 "2019-02-26T12:23:16Z")\
**Posts on this page:** 1\
**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, 12:23pm UTC](https://forum.ansible.com/t/how-to-delete-a-duplicate-in-file/29774/1 "2019-02-26T12:23:16Z")

</div>

Hy all,

how to delete a duplicate in a file?

Exemple, in my file1 there is :

user1  
user2  
user3  
user1  
user1  
user1

I want that my task delete all duplicate for get this file :

user1  
user2  
user3

Thanks

Regards
