How to import data in R from the CSV if unexpectedly occurs in some of the lines LF instead CRLF

67 Views Asked by At

There is a file with this content (6 lines):

field name,english description,russian description,format**CRLF**
name,name of ndicator, Наименование показателя,varchar(1000)**CRLF**
okpo,OKPO code,Код ОКПО,varchar(8)**CRLF**
11103,"indicator value**LF**
",значение показателя,varchar(15)**CRLF**
11104,"indicator value**LF**
",значение показателя,varchar(15)**CRLF**
11203,"indicator value**LF**
",значение показателя,varchar(15)**CRLF**

We are trying to load its content with the following code:

data.structure.timing <- system.time(gks_structure <- fread(gks_structure_file_name, showProgress = TRUE, sep=(","), quote="",header=TRUE))

But an error appears because the LF is perceived as a line break. The system expects 4 values, but only gets 2. How to write code so that sep was also on LF too?

0

There are 0 best solutions below