# Convert path string to list of all paths

**URL:** <https://forum.ansible.com/t/convert-path-string-to-list-of-all-paths/35585>\
**Category:** Ansible Project\
**Created:** [August 4, 2021, 10:55pm UTC](https://forum.ansible.com/t/convert-path-string-to-list-of-all-paths/35585 "2021-08-04T22:55:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_McKenzie](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@William\_McKenzie](https://forum.ansible.com/u/William_McKenzie)\
**Post date:** [August 4, 2021, 10:55pm UTC](https://forum.ansible.com/t/convert-path-string-to-list-of-all-paths/35585/1 "2021-08-04T22:55:21Z")

</div>

Is there any simple expression/filter magic that would allow me to convert a path string to a list of all the contained paths.

So:  
“a/b/c/d”

would become:

[“a”, “a/b” , “a/b/c” , “a/b/c/d”]

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 5, 2021, 7:39pm UTC](https://forum.ansible.com/t/convert-path-string-to-list-of-all-paths/35585/2 "2021-08-05T19:39:21Z")

</div>


