Editing a variable (Searching from end)
Posted: 14 Apr 2023 11:19
Hello
I am trying to perfect a batch file that uses FFMpeg to convert videos to MP3's.
As an example the title of the video might be something like
David Bowie - Life on Mars.mp4
or maybe
David Bowie - Greatest Hits - Life on Mars.mp4
I'd like to extract the track title "Life on Mars" from these filenames to create ID tags in the MP3 file and have loaded the filename into a variable like %filename%.
Please could you suggest some code that would edit %filename% to give the desired result?
Basically I need to search backwards from the end of the string until I encounter the first "<Hypen><Space>" and only save the text that comes afterwards in %filename%.
Thanks
Robin
I am trying to perfect a batch file that uses FFMpeg to convert videos to MP3's.
As an example the title of the video might be something like
David Bowie - Life on Mars.mp4
or maybe
David Bowie - Greatest Hits - Life on Mars.mp4
I'd like to extract the track title "Life on Mars" from these filenames to create ID tags in the MP3 file and have loaded the filename into a variable like %filename%.
Please could you suggest some code that would edit %filename% to give the desired result?
Basically I need to search backwards from the end of the string until I encounter the first "<Hypen><Space>" and only save the text that comes afterwards in %filename%.
Thanks
Robin