用skill编写一个程序计算出文档的行数
Description得出某文檔之行數
Arguments
filename string,檔名,若該檔在board file之目錄內,則僅輸入檔名即可,否則必須輸入絕對路徑名稱。
Value Returned
number 文檔之總行數。
Example
CountLineNO("file1.txt")
124 檔案file1.txt有124行。
CountLineNO("C:/dir1/dir2/file2.txt")
3400 檔案file2.txt有3400行。(file2.txt不在board file之目錄內)
本帖最后由 leilei4908 于 2016-6-22 09:08 编辑
axlCmdRegister( "CountLineNo" 'CountLineNo)
axlSetAlias("cl" "CountLineNo")
procedure( CountLineNo(@optional (path nil))
prog((txt fileName num)
unless(path
path = axlDMFileBrowse(nil nil)
)
unless(path return(nil))
txt = infile(path)
fileName = car(last(parseString(path "\\/")))
num = 0
while(gets(Line txt)
num = num + 1
)
close(txt)
printf("%n Document:%s is counted to row %n" num fileName num)
))
可以按照你的方法查询行数,也可以只输入CountLineNo或者cl,通过Browse找到文件 leilei4908 发表于 2016-6-22 09:06
可以按照你的方法查询行数,也可以只输入CountLineNo或者cl,通过Browse找到文件
感谢
页:
[1]