fread and a quoted multi-line column value

后端 未结 1 1188
予麋鹿
予麋鹿 2020-12-21 01:06
> fread(\'col1,col2\\n\')
Empty data.table (0 rows) of 2 cols: col1,col2
> fread(\'col1,col2\\n5,4\')
   col1 col2
1:    5    4
> fread(\'col1,col2\\n5,\"4\         


        
相关标签:
1条回答
  • 2020-12-21 01:49

    UPDATE: Now fixed in v1.9.3 on GitHub :

    • fread() now accepts line breaks inside quoted fields. Thanks to Clayton Stanley for highlighting.



    This error has been reported before and it's on the list to do. But what's new here is the \n inside the quotes. I hadn't realised that was a use case giving rise to the error.

    Many thanks for reporting. It'll be fixed.

    Similar question but not exactly the same here :

    data.table::fread and Unbalanced "

    and the bug report is here :

    https://r-forge.r-project.org/tracker/?group_id=240&atid=975&func=detail&aid=2694

    0 讨论(0)
提交回复
热议问题