神剑山庄资源网 Design By www.hcban.com
写的一个关于遍历文件的程序段 记录一下咯
--[[检查所有.txt文件 比如A.txt中第一行规定有20列,但是在X行中多输入一个Tab,则输出:A表的X行填写不规范,行末有多余填写 ]] getinfo = io.popen('dir ..//file /b /s') all = getinfo:read('*all') local filenameList = io.open("filename.txt", "wb") filenameList:write("Path/n") filenameList:close() filenameList = io.open("filename.txt", "a") filenameList:write(all) io.close(filenameList) io.close(getinfo) local filenameList = tab.Open([[../filename.txt]], "Path", false) for index, Row in ipairs(filenameList) do local pathlist = Row["Path"] local rowString = string.find(pathlist, ".txt") if rowString ~= nil and rowString ~="" then moon.CheckRowlength(pathlist, pathlist) end end io.popen('dir /b /s')是windows下的,通过执行命令行dir获得 io.popen('ls')是linux下的
标签:
Lua,遍历文件
神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com
暂无Lua中遍历文件操作代码实例的评论...
更新日志
2024年10月04日
2024年10月04日
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]
- 班得瑞原装进口《第九张新世纪专辑:微风山谷》1CD[APE/CUE分轨][331MB]
- 陈慧琳.2008-Love.Fighters演唱会3CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 米志宏.1994-HAPPY1994【波丽佳音】【WAV+CUE】
- 潘美辰.2006-最冷的夏天(引进版)【美梦辰真】【WAV+CUE】
- 班得瑞原装进口《第十张新世纪专辑:月光水岸》1CD[APE/CUE分轨][277.2MB]
- 班得瑞原装进口《第十一张新世纪专辑:雾色山脉》1CD[APE/CUE分轨][291.6MB]
- 班得瑞原装进口《第十二张新世纪专辑:翡翠谷》1CD[APE/CUE分轨][307.9MB]
- 高卿尘.2024-情绪商店【Hahahai】【FLAC分轨】
- 王恩喆.2024-黄沙【KOOD】【FLAC分轨】