Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/local/bin/python3
- """ This script is to rename the files
- "Friends Season ## Episode ## - *.avi"
- to
- "Friends S##E## - *.avi"
- Example:
- This:
- "Friends Season 09 Episode 01 - The One Where No One Proposes.avi"
- will be changed to:
- "Friends S09e01 - The One Where No One Proposes.avi"
- """
- import os
- import shutil
- import re
- series_pattern = re.compile(r'^(.*)(Season )(/d{2})( Episode )(/d{2})(.*)$')
- sample_string = "Friends Season 09 Episode 01 - The One Where No One Proposes\
- .avi"
- result = series_pattern.search(sample_string)
- print(result.group())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement