从文件名中删除无用字符

trimfilename的Python项目详细描述


Stories in Ready

从文件名中修剪特定模式的脚本。

在所述路径上递归检查文件的模式匹配 或在当前工作目录中。

用法

home $ ls songs
04_maroon5_she_will_be_loved.mp3        05 Flo Rida-Whistle.mp3
Nelly-Just A Dream 2010.mp3             David Archuleta - A Little Too Not Over You000.mp3


home $ trimfilename songs
parsing directory: songs
Files renamed:
songs/04_maroon5_she_will_be_loved.mp3    : maroon5_-_she_will_be_loved-tn.mp3
songs/05 Flo Rida-Whistle.mp3             : Flo Rida - Whistle.mp3

Successfully renamed 2 file/s


home $ ls thumbs
AlbumArt_Adele_Large.jpg  AlbumArt_hall_of_fame_Large.jpg  AlbumArt_lotavo_Large.jpg


home $ trimfilename thumbs -b AlbumArt_
parsing directory: thumbs
Files renamed:
thumbs/AlbumArt_Adele_Large.jpg        : Adele_Large.jpg
thumbs/AlbumArt_hall_of_fame_Large.jpg : hall_of_fame_Large.jpg
thumbs/AlbumArt_lotavo_Large.jpg       : lotavo_Large.jpg

Successfully renamed 3 file/s


home $ ls thumbs
Adele_Large.jpg  hall_of_fame_Large.jpg  lotavo_Large.jpg


home $ trimfilename thumbs -p _large -i
parsing directory: thumbs
Files renamed:
thumbs/lotavo_Large.jpg       : lotavo.jpg
thumbs/hall_of_fame_Large.jpg : hall_of_fame.jpg
thumbs/Adele_Large.jpg        : Adele.jpg

Successfully renamed 3 file/s

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android同步不同页面上的按钮   java评测每个类收集的垃圾对象实例数   java(Spring MVC+Hibernate 4+Test 4)自动连线DAO返回NULL   java Android编辑文本和虚拟键盘   java Selenium与BrowserMobProxy   JAVAlang.NoClassDefFoundError:com/sun/jersey/spi/inject/Errors$关闭原因?   java为什么在我成功登录后仍然会出现“不正确的帐户或密码或用户类型”   安卓应用程序在重新启动java时崩溃。网UnknownHostException:无法解析主机   多线程在Java中同步共享静态对象的正确方法是什么?   未调用自定义注释的java类验证(约束类)   java如何将指定目录的存档文件放入所需位置?   java如何识别Selenium中的每个编辑文本字段,如果它们的Xpath都相同   使用gwtmockito/mockito的java简单单选按钮单元测试?