自动化的视频文件重命名 [英] Automate renaming of video files

查看:114
本文介绍了自动化的视频文件重命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多我想要重命名的文件,它会带我很长的时间做手工他们。他们的视频文件,通常这种格式 - SHOW名称 - 集数 - EPISODE NAME,因此,例如,绝命 - 101 - 飞行员

我想这样做的是改变了101的一部分,以我自己的S01E01的约定。我想,在一个系列演出,这串唯一的顺序部分是最后一个数字,即得。 S01E01,S01E02,S01E03,S01E04等等...

会有人可以给我如何做这在Mac OS X上的终端的意见,我认为这是过于复杂使用Automator或其他批量重命名的程序做...

感谢


解决方案

 为FOO的*;做MV$ FOO'回声$ FOO | sed的'S / \\([^  ​​- ] * \\) -  \\([0-9] \\)\\([0-9] [0-9] \\)\\ (* \\)/ \\ 1  -  S0 \\ 2E \\ 3 \\ 4 / g'` DONE

这工作,如果有不到10个赛季。

I have a lot of files I want to rename and it would take me a long time to do them manually. They are video files and are usually in this format - "NAME OF SHOW - EPISODE NUMBER - EPISODE NAME", so for example "Breaking Bad - 101 - Pilot".

What I would like to do is change the "101" part to my own convention of "S01E01". I figure that in one series of a show the only sequential part of that string is the last number, ie. S01E01, S01E02, S01E03, S01E04 etc...

Would anyone be able to give me advice on how to do this on terminal on Mac OS X. I believe it is too complicated to do with Automator or other batch renaming programs...

Thanks

解决方案

for FOO in *; do mv "$FOO" "`echo $FOO | sed 's/\([^-]*\) - \([0-9]\)\([0-9][0-9]\)\(.*\)/\1 - S0\2E\3\4/g'`" ; done

This works if there are less than 10 seasons.

这篇关于自动化的视频文件重命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆