{"action":"closed","issue":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/923","labels_url":"https://api.github.com/repos/Rdatatable/data.table/issues/923/labels{/name}","comments_url":"https://api.github.com/repos/Rdatatable/data.table/issues/923/comments","events_url":"https://api.github.com/repos/Rdatatable/data.table/issues/923/events","html_url":"https://github.com/Rdatatable/data.table/issues/923","id":47209802,"number":923,"title":"fread() does not always detect separator correctly when commas in text fields?","user":{"login":"raymondben","id":6445827,"avatar_url":"https://avatars.githubusercontent.com/u/6445827?v=3","gravatar_id":"","url":"https://api.github.com/users/raymondben","html_url":"https://github.com/raymondben","followers_url":"https://api.github.com/users/raymondben/followers","following_url":"https://api.github.com/users/raymondben/following{/other_user}","gists_url":"https://api.github.com/users/raymondben/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondben/subscriptions","organizations_url":"https://api.github.com/users/raymondben/orgs","repos_url":"https://api.github.com/users/raymondben/repos","events_url":"https://api.github.com/users/raymondben/events{/privacy}","received_events_url":"https://api.github.com/users/raymondben/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Rdatatable/data.table/labels/bug","name":"bug","color":"DF3A2C"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-10-29T22:03:33Z","updated_at":"2015-03-16T03:09:10Z","closed_at":"2015-03-16T03:09:10Z","body":"Should detect sep as \"\\t\":\r\n\r\n```R\r\nfread(sprintf(\"\\\"a\\\"\\t\\\"b\\\"\\n\\\"this,that\\\"\\t2\\n\"),verbose=TRUE)\r\n# Input contains a \\n (or is \"\"). Taking this to be text input (not a filename)\r\n# Detected eol as \\n only (no \\r afterwards), the UNIX and Mac standard.\r\n# Using line 2 to detect sep (the last non blank line in the first 'autostart') ... sep=','\r\n# [truncated]\r\n```\r\nRemoving the embedded comma detects sep correctly:\r\n\r\n```R\r\nfread(sprintf(\"\\\"a\\\"\\t\\\"b\\\"\\n\\\"this_that\\\"\\t2\\n\"),verbose=TRUE)\r\n# Input contains a \\n (or is \"\"). Taking this to be text input (not a filename)\r\n# Detected eol as \\n only (no \\r afterwards), the UNIX and Mac standard.\r\n# Using line 2 to detect sep (the last non blank line in the first 'autostart') ... sep='\\t'\r\n```\r\n\r\n```R\r\nsessionInfo()\r\n# R version 3.1.1 (2014-07-10)\r\n# Platform: x86_64-pc-linux-gnu (64-bit)\r\n\r\n# locale:\r\n#  [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8       \r\n#  [4] LC_COLLATE=en_AU.UTF-8     LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   \r\n#  [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                  LC_ADDRESS=C              \r\n# [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       \r\n\r\n# attached base packages:\r\n# [1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\n# other attached packages:\r\n# [1] data.table_1.9.4 Defaults_1.1-1  \r\n\r\n# loaded via a namespace (and not attached):\r\n# [1] chron_2.3-45  plyr_1.8.1    Rcpp_0.11.2   reshape2_1.4  stringr_0.6.2 tools_3.1.1  \r\n```"}}