重命名多个文件名(删除文件名结尾)
我想将这些文件重命名为不以 (.processed2011*) 结尾,
因此,基本上,重命名
self_reported_user_activity_1404414367_131826464204632784.csv.processed20111011014111557
self_reported_user_activity_1404539338_131826361077732732.csv.processed20111011021401718 self_reported_user_activity_1404418376_131826222854532675.csv.processed20111011014301356
self_reported_user_activity_1404539858_131826370284032733.csv.processed20111011021431708
到
self_reported_user_activity_1404414367_131826464204632784.csv self_reported_user_activity_1404539338_131826361077732732.csv self_reported_user_activity_1404418376_131826222854532675.csv self_reported_user_activity_1404539858_131826370284032733.csv
我的“重命名”命令如下(不带正则表达式):
NAME 重命名 - 重命名文件 概要 重命名为文件...
谢谢
I would like to rename these files to not have the ending of (.processed2011*)
So, basically, rename
self_reported_user_activity_1404414367_131826464204632784.csv.processed20111011014111557
self_reported_user_activity_1404539338_131826361077732732.csv.processed20111011021401718
self_reported_user_activity_1404418376_131826222854532675.csv.processed20111011014301356
self_reported_user_activity_1404539858_131826370284032733.csv.processed20111011021431708
to
self_reported_user_activity_1404414367_131826464204632784.csv
self_reported_user_activity_1404539338_131826361077732732.csv
self_reported_user_activity_1404418376_131826222854532675.csv
self_reported_user_activity_1404539858_131826370284032733.csv
My 'rename' command is the following (without regex):
NAME
rename - Rename files
SYNOPSIS
rename from to file...
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会尝试使用“剪切”命令。像这样的事情:
I would try using the "cut" command. Something like this:
尝试
${string%substring}
,它会从字符串后面删除substring
的最长匹配项。因此,如果line
包含self_...
:Try
${string%substring}
which deletes the longest match ofsubstring
from the back of the string. So ifline
contains aself_...
: