R语言readLines函数

R语言逐行读取文件:

con <- file(inFile, "r")
lineCnt = 0
while(1){
	oneline = readLines(con, n = 1)
	if(length(oneline) == 0){
		break
	}
	lineCnt = lineCnt+1
}
close(con)


你可能感兴趣的:(R语言readLines函数)