0

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?

  • 1
    Not sure how big your file is. Can you simply read the whole file as string and replace LF with CRLF? – Feng Jiang Sep 26 '20 at 12:49
  • It's not big, but I don't show you how to do it –  Sep 26 '20 at 16:44
  • Does this answer your question? [R read.csv how to ignore carriage return?](https://stackoverflow.com/questions/30781666/r-read-csv-how-to-ignore-carriage-return) – Orace Apr 30 '21 at 16:18

0 Answers0