• lua 批量重命名文件


    local s = io.popen("dir F:\headicon /b/s")
    local filelist = s:read("*all")
    
    local start_pos = 0
    local count = 0
    while true 
    do 
        _,end_pos, line = string.find(filelist, "([^
    
    ]+.jpg)", start_pos)
        if not end_pos then 
            break
        end
        count = count + 1
        if count <= 100 then
            os.rename(line , string.format("F:\headicon\%s.jpg", count)) 
        end 
    
        print(line)
        start_pos = end_pos + 1
    end
    

      

  • 相关阅读:
    poj 2251
    poj 1321
    poj 2777
    poj 3468
    poj 2318
    javascript
    buhui
    swift 构造器
    mac上不了网
    字体
  • 原文地址:https://www.cnblogs.com/xshang/p/7862395.html
Copyright © 2020-2023  润新知