Skip to content

Fix sorting of filenames with alphanumeric prefixes.#248

Open
branyang02 wants to merge 1 commit intofacebookresearch:mainfrom
branyang02:main
Open

Fix sorting of filenames with alphanumeric prefixes.#248
branyang02 wants to merge 1 commit intofacebookresearch:mainfrom
branyang02:main

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