Mar-25-2020, 01:14 PM
Hello,
I am looking for a solution that I can make nested directories based on an unsorted list.
Here is a simplified example:
Input:
unsorted_list = ['Abb', 'B', 'Ab', 'Aba', 'Ba 2', 'Ba 1', 'C', 'A', 'Abc', 'Ac', 'Ba', 'Ba 11']
Output:
.
├── A
│ ├── Ab
│ │ ├── Abe
│ │ └── Aby
│ └── Ad
├── B
│ └── Be
│ ├── Bee 1
│ │ └── Bee 11
│ └── Bee 2
└── C
The tree shows the desired directory structure to be created in the file system.
Thanks a lot for your ideas!
Kind regards,
koebi
I am looking for a solution that I can make nested directories based on an unsorted list.
Here is a simplified example:
Input:
unsorted_list = ['Abb', 'B', 'Ab', 'Aba', 'Ba 2', 'Ba 1', 'C', 'A', 'Abc', 'Ac', 'Ba', 'Ba 11']
Output:
.
├── A
│ ├── Ab
│ │ ├── Abe
│ │ └── Aby
│ └── Ad
├── B
│ └── Be
│ ├── Bee 1
│ │ └── Bee 11
│ └── Bee 2
└── C
The tree shows the desired directory structure to be created in the file system.
Thanks a lot for your ideas!
Kind regards,
koebi