参考https://www.dolphindb.cn/cn/h...,写函数如下:
def lineCount(fileName){ h = file(fileName) bufSize = 102400 buf = array(CHAR, bufSize) lines = 0 do { numByte = h.read!(buf,0,bufSize) lines += sum(subarray(buf, 0 : numByte) == '\n') }while(numByte == bufSize) return lines }