I have a few video file like this:
VideoName_s01e01.mp4
where the season and episodes are variables. I want to add an underscore ("_") between the s??
and e??
.
I have been using powershell for renaming purposes, I have a starting point:
GCI $path -filter '*_s??e??*' -rec | Ren -new { $_.name -replace '_s[0-9][0-9]', '_s[0-9]_[0-9]_' } -passthru
This actually renamed my files VideoName_s[0-9]_e[0-9].mp4
.
Basically, I am looking for the characters s??e??
I just don't know how to make them variables in the replace section.
I think the best method would be:
- Find the position of
e??s??
(let's call it X).
- split the string at
X-3
.
- concatenate the string with a "
_
" in the middle.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…