'Embedded nul in string' error when importing csv with fread

后端 未结 6 1217
[愿得一人]
[愿得一人] 2020-11-29 08:56

I have a large file (3.5G) that I\'m trying to import using data.table::fread.

It was originally created from an rpt file that was opened as text and sa

6条回答
  •  温柔的废话
    2020-11-29 09:53

    In this case, you can use read.csv with fileEncoding of UTF-16LE rather than fread.

    read.csv("mycsv.csv",fileEncoding="UTF-16LE")
    

    Considering your data size, using read.csv would take a couple of minutes, but I think it is not a big deal.

提交回复
热议问题