local s = io.popen("dir C:\\Users\\lizhiyuan\\Desktop\\国家知识产权局ftp法律状态数据\\data /b/s")
local filelist = s:read("*a")
local start_pos = 0
while 1 do
_,end_pos,line = string.find(filelist, "([^\n\r]+.xml)", start_pos)
if not end_pos then
break
end
oldname = string.match(line,"0_.-.xml")
newname = string.gsub(oldname,"135169","119")
os.rename(line, string.format("C:\\Users\\lizhiyuan\\Desktop\\国家知识产权局ftp法律状态数据\\data\\%s",newname))
start_pos = end_pos+1
end
文章来源地址https://www.toymoban.com/news/detail-576843.html
文章来源:https://www.toymoban.com/news/detail-576843.html
到了这里,关于Lua 批量修改文件夹下文件名的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!