Skip to content

Filepath Sort

Sorts a list of filepaths by various criteria.

Inputs#

Port Description
Paths
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.txt comes before b/c.txt
  • Reverse Alphabetical (reverse_alphabetical): Sorts filepaths in reverse alphabetical order (Z-A).
    • Example: b/c.txt comes before a/b.txt
  • By Extension (by_extension): Sorts filepaths alphabetically based on their file extension.
    • Example: path/to/file.avi comes before another/file.txt
  • By Directory Depth (by_directory_depth): Sorts filepaths by the number of directories in their path, from fewest to most.
  • Example: /file.txt comes 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.txt comes before short/path/bb.txt

ID: core/filepath-sort@v1