这就是我想要做的:
前:
AVCHD/2017-08-25/20170824_GV_GLW_C102/private
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/AVCHD
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/AVCHD/BDMV
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/AVCHD/BDMV/CLIPINF
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/AVCHD/BDMV/PLAYLIST
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/AVCHD/BDMV/STREAM
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/Converted
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/M4ROOT
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/M4ROOT/CLIP
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/M4ROOT/GENERAL
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/M4ROOT/SUB
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/M4ROOT/THMBNL
AVCHD/2017-08-25/20170824_GV_GLW_C102/private/SONY
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/AVCHD/BDMV/STREAM
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/Converted
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/M4ROOT
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/M4ROOT/CLIP
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/M4ROOT/GENERAL
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/M4ROOT/SUB
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/M4ROOT/THMBNL
AVCHD/2017-08-24/20170822_GV_GLW_C099/PRIVATE/SONY
后:
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170824_GV_GLW_C102
20170822_GV_GLW_C099
20170822_GV_GLW_C099
20170822_GV_GLW_C099
20170822_GV_GLW_C099
20170822_GV_GLW_C099
20170822_GV_GLW_C099
20170822_GV_GLW_C099
20170822_GV_GLW_C099
一旦我能够将目录路径缩减为它们的父文件夹名称(如此处所示),我就会删除所有重复项。
父文件夹始终包含以下精确结构:“XXXXXXXX_XX_XXX_XXXX”
我需要删除该结构出现之前和之后的所有文本,只留下父文件夹名称
任何帮助都非常感谢!
答案1
您可以使用 Notepad++ 的查找和替换功能,常用表达。根据文件夹名称的设置方式,您可以在搜索框中使用类似这样的内容(这是一个非常丑陋的表达,但它适用于您的示例。):
.*?(\d{8}_[A-Z]{2}_[A-Z]{3}_[A-Z]\d{3}).*
在“替换为”框中,你可以输入
\1
表达式解释:
.*
接受任意数量的任意字符。后面的问号表示使用惰性匹配\d{8}
匹配 8 位数字_
匹配下划线[A-Z]{2}
匹配 2 个大写字母- 括号之间的区域构成一个捕获组,您可以将其用作值来进行替换
答案2
查找方式:
^.+/(\d{8}_.{2}_.{3}_.{4})/.+$
用。。。来代替:
$1
全部替换