How to rename file with sequential numbering? : I have a number of files with the following naming:

    name1.name2.s01.ep01.RANDOMWORD.mp4
    name1.name2.s01.ep02.RANDOMWORD.mp4
    name1.name2.s01.ep03.RANDOMWORD.mp4

I need to remove everything between last . and ep# from the file names and only have `name1.name2.s01.ep01.mp4` (sometimes extension can be different)

    name1.name2.s01.ep01.mp4
    name1.name2.s01.ep02.mp4

