Python program to list a directory using different parts of filenames.

bobbyblues 036f51b363 Initial commit 2 years ago
example 036f51b363 Initial commit 2 years ago
.gitignore 5e0dc12d35 initial commit 2 years ago
README.md 036f51b363 Initial commit 2 years ago
lsort.py 036f51b363 Initial commit 2 years ago

README.md

lsort

Python program to list a directory using different parts of filenames. By default lsort splits filenames and directory names using the '-' character, and then sort them according to the first, second, etc. part of the name.

Usage

lsort [-c splitting-character] directory index

Example

Here is the result of lsort when ran on the example directory:

~/projects/lsort  lsort example 1
1973 - Queen - Queen
1974 - Deep Purple - Burn
1974 - Deep Purple - Stormbringer
1974 - Queen - Queen II
1974 - Queen - Sheer heart attack
1975 - Deep Purple - Come taste the band
1975 - Queen - A night at the opera
1976 - Deep Purple - Who do we think we are
1976 - Queen - A day at the races

~/projects/lsort  lsort example 2
1974 - Deep Purple - Burn
1974 - Deep Purple - Stormbringer
1975 - Deep Purple - Come taste the band
1976 - Deep Purple - Who do we think we are
1973 - Queen - Queen
1974 - Queen - Queen II
1974 - Queen - Sheer heart attack
1975 - Queen - A night at the opera
1976 - Queen - A day at the races

~/projects/lsort  lsort example 3
1976 - Queen - A day at the races
1975 - Queen - A night at the opera
1974 - Deep Purple - Burn
1975 - Deep Purple - Come taste the band
1973 - Queen - Queen
1974 - Queen - Queen II
1974 - Queen - Sheer heart attack
1974 - Deep Purple - Stormbringer
1976 - Deep Purple - Who do we think we are