Filepath Sort
Sorts a list of filepaths by various criteria.
Inputs#
| Port | Description |
|---|---|
| A list of filepaths to sort. | |
| The criterion used for sorting. |
Outputs#
| Port | Description |
|---|---|
| The sorted list of filepaths. |
Addendum#
This node sorts a list of filepaths based on a selected criterion.
Sorting Options#
- Alphabetical (
alphabetical): Sorts filepaths in standard alphabetical order (A-Z).- Example:
a/b.txtcomes beforeb/c.txt
- Example:
- Reverse Alphabetical (
reverse_alphabetical): Sorts filepaths in reverse alphabetical order (Z-A).- Example:
b/c.txtcomes beforea/b.txt
- Example:
- By Extension (
by_extension): Sorts filepaths alphabetically based on their file extension.- Example:
path/to/file.avicomes beforeanother/file.txt
- Example:
- By Directory Depth (
by_directory_depth): Sorts filepaths by the number of directories in their path, from fewest to most. - Example:
/file.txtcomes before/folder/file.txt - By Filename Length (
by_filename_length): Sorts filepaths by the length of their filename (including extension), from shortest to longest. The directory path is ignored.- Example:
long/path/to/a.txtcomes beforeshort/path/bb.txt
- Example:
ID: core/filepath-sort@v1