Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sorting of filenames with alphanumeric prefixes. #248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

branyang02
Copy link

Enhance filename sorting by extracting numeric parts

  • Added a new function _extract_numeric to extract numeric values from filenames containing alphanumeric characters.
  • Updated the sorting key function to utilize _extract_numeric, improving handling of filenames with both numeric prefixes and postfixes (e.g., 'DSCF5858', 'IMG1234').
  • Ensured compatibility with filenames where numeric values are embedded within strings.

Copy link

@ShuoShenDe ShuoShenDe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extract number function works when the name is with number, but fails when there are multiple numeric parts in the name

@sam31046
Copy link

My solution here is to allow passing a list into it:
#214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants