一种解决方案是将文件作为字符串读取并用换行符替换分号。
fileName = 'myfile.txt'
filecontent = readChar(fileName, file.info(fileName)$size)
filecontent = gsub(";", "\n", filecontent)
con = textConnection(filecontent)
read.table(con,sep=",")
Run Code Online (Sandbox Code Playgroud)