在r中导入没有一致模式的txt文件

在r中导入没有一致模式的txt文件,r,R,我有一个txt文件,如下所示: '111001', '1', 'C:\Users\dicelab\Desktop\mar\ExPart1_C1.exp', 'default.mlp', '10/3/2017', '12:14:03' Don't drop out of school. '121002', '1', 'C:\Users\dicelab\Desktop\mar\ExPart1_C1.exp', 'default.mlp', '10/3/2017', '14:04:13' he sho

我有一个txt文件,如下所示:

'111001', '1', 'C:\Users\dicelab\Desktop\mar\ExPart1_C1.exp', 'default.mlp', '10/3/2017', '12:14:03'
Don't drop out of school.
'121002', '1', 'C:\Users\dicelab\Desktop\mar\ExPart1_C1.exp', 'default.mlp', '10/3/2017', '14:04:13'
he should finish his degree!
在文件中,一个条目被分成两行。例如,第一个条目应如下所示:

'111001', '1', 'C:\Users\dicelab\Desktop\mar\ExPart1_C1.exp', 'default.mlp', '10/3/2017', '12:14:03', 'Don't drop out of school.'
然后我想把文件导入R,每个引用的内容应该是一个单元格。例如,第一行应该如下所示:

 111001 1 C:\Users\dicelab\Desktop\mar\ExPart1_C1.exp default.mlp 10/3/2017 12:14:03 Don't drop out of school

在上面的示例中,111001、1、C:\Users\dicelab\Desktop\mar\ExPart1\u C1.exp等是分开的,每个都有一列

如果每行正好占用两行,则可以将文件拆分为csv部分和非csv部分。比如说

lines <- readLines("2row.txt")
dd <- read.csv(text=lines[seq(1, length(lines), by=2)], header=F)
dd$comments = lines[seq(2, length(lines), by=2)]

行,那么每条记录正好是两行数据?任何文本行中都没有嵌入换行符?@MrFlick没错!