I would like to select the base name portion of a file path excluding the file extension.
For example, if the path is something like the following: /experimental/users/nerd/wavfiles/wavfile0722.wav Then, I would like to select "wavefile0722" portion of the above path.
I have been using the following statement in Python for this purpose.
basename_wo_ext = re.sub('\.[^\.]*', '' , os.path.basename(file_path))
But I wonder whether it is a good approach or not, and if not, what would be the best way for this case.
Any suggestions are welcomed. Thank you!