read_csv does not work separate commas and not capture separate rows The Next CEO of Stack OverflowHow to read data when some numbers contain commas as thousand separator?Comma separator for numbers in R?Creating a comma separated vectorSeparate Comma Delimited Cells To New RowsSplit comma-separated strings in a column into separate rowsHow to separate comma separated values in R in a new row?Reading a list of data frames from a comma separated text file with comments, automateSplit multiple comma-separated column into separate rowsImplementation of LIFO in converting comma separated row values into separate row valuesVectorized euclidean distance between 2 dataset in r
Is it a bad idea to plug the other end of ESD strap to wall ground?
The sum of any ten consecutive numbers from a fibonacci sequence is divisible by 11
Free fall ellipse or parabola?
"Eavesdropping" vs "Listen in on"
Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?
What difference does it make matching a word with/without a trailing whitespace?
Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact
Horror film about a man brought out of cryogenic suspension without a soul, around 1990
Why was Sir Cadogan fired?
How can the PCs determine if an item is a phylactery?
Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico
How to pronounce fünf in 45
Plausibility of squid whales
Why did the Drakh emissary look so blurred in S04:E11 "Lines of Communication"?
Noise during hard braking
How to avoid supervisors with prejudiced views?
Is a distribution that is normal, but highly skewed, considered Gaussian?
Salesforce opportunity stages
subequations: How to continue numbering within subequation?
How can a day be of 24 hours?
Does Germany produce more waste than the US?
Find the majority element, which appears more than half the time
It it possible to avoid kiwi.com's automatic online check-in and instead do it manually by yourself?
Shortening a title without changing its meaning
read_csv does not work separate commas and not capture separate rows
The Next CEO of Stack OverflowHow to read data when some numbers contain commas as thousand separator?Comma separator for numbers in R?Creating a comma separated vectorSeparate Comma Delimited Cells To New RowsSplit comma-separated strings in a column into separate rowsHow to separate comma separated values in R in a new row?Reading a list of data frames from a comma separated text file with comments, automateSplit multiple comma-separated column into separate rowsImplementation of LIFO in converting comma separated row values into separate row valuesVectorized euclidean distance between 2 dataset in r
I am trying to parse a text log file like this, I can use the default read.csv to parse this file.
test <- read.csv("test.txt", header=FALSE)
It separated all comma parts, though not perfectly put in a dataframe, further manipulation can be done to improve.
However, I can not seem to do so using readr package
test <- read_csv("test.txt", header=FALSE)
All observations turn into 1 row, no separation between commas.
I am learning this package so any help would be great.
"dev_id":"f8:f0:05:xx:db:xx","data":["dist":[7270,7269,7269,7275,7270,7271,7265,7270,7274,7267,7271,7271,7266,7263,7268,7271,7266,7265,7270,7268,7264,7270,7261,7260],"temp":0,"hum":0,"vin":448],"time":4485318,"transmit_time":4495658,"version":"1.0"
"dev_id":"f8:xx:05:xx:d9:xx","data":["dist":[6869,6868,6867,6871,6866,6867,6863,6865,6868,6869,6868,6860,6865,6866,6870,6861,6865,6868,6866,6864,6866,6866,6865,6872],"temp":0,"hum":0,"vin":449],"time":4405316,"transmit_time":4413715,"version":"1.0"
"dev_id":"xx:f0:05:e8:da:xx","data":["dist":[5775,5775,5777,5772,5777,5770,5779,5773,5776,5777,5772,5768,5782,5772,5765,5770,5770,5767,5767,5777,5766,5763,5773,5776],"temp":0,"hum":0,"vin":447],"time":4461316,"transmit_time":4473307,"version":"1.0"
"dev_id":"xx:f0:xx:e8:xx:0a","data":["dist":[4358,4361,4355,4358,4359,4359,4361,4358,4359,4360,4360,4361,4361,4359,4359,4356,4357,4361,4359,4360,4358,4358,4362,4359],"temp":0,"hum":0,"vin":424],"time":5190320,"transmit_time":5198748,"version":"1.0"
r
add a comment |
I am trying to parse a text log file like this, I can use the default read.csv to parse this file.
test <- read.csv("test.txt", header=FALSE)
It separated all comma parts, though not perfectly put in a dataframe, further manipulation can be done to improve.
However, I can not seem to do so using readr package
test <- read_csv("test.txt", header=FALSE)
All observations turn into 1 row, no separation between commas.
I am learning this package so any help would be great.
"dev_id":"f8:f0:05:xx:db:xx","data":["dist":[7270,7269,7269,7275,7270,7271,7265,7270,7274,7267,7271,7271,7266,7263,7268,7271,7266,7265,7270,7268,7264,7270,7261,7260],"temp":0,"hum":0,"vin":448],"time":4485318,"transmit_time":4495658,"version":"1.0"
"dev_id":"f8:xx:05:xx:d9:xx","data":["dist":[6869,6868,6867,6871,6866,6867,6863,6865,6868,6869,6868,6860,6865,6866,6870,6861,6865,6868,6866,6864,6866,6866,6865,6872],"temp":0,"hum":0,"vin":449],"time":4405316,"transmit_time":4413715,"version":"1.0"
"dev_id":"xx:f0:05:e8:da:xx","data":["dist":[5775,5775,5777,5772,5777,5770,5779,5773,5776,5777,5772,5768,5782,5772,5765,5770,5770,5767,5767,5777,5766,5763,5773,5776],"temp":0,"hum":0,"vin":447],"time":4461316,"transmit_time":4473307,"version":"1.0"
"dev_id":"xx:f0:xx:e8:xx:0a","data":["dist":[4358,4361,4355,4358,4359,4359,4361,4358,4359,4360,4360,4361,4361,4359,4359,4356,4357,4361,4359,4360,4358,4358,4362,4359],"temp":0,"hum":0,"vin":424],"time":5190320,"transmit_time":5198748,"version":"1.0"
r
2
Your sample data looks to be in JSON format. Trying using the` jsonlite` or similar package to parse the data.
– Dave2e
Mar 21 at 17:53
Thanks a lot for your info. I found it using ndjson::stream_in
– viet_datar
Mar 21 at 19:27
add a comment |
I am trying to parse a text log file like this, I can use the default read.csv to parse this file.
test <- read.csv("test.txt", header=FALSE)
It separated all comma parts, though not perfectly put in a dataframe, further manipulation can be done to improve.
However, I can not seem to do so using readr package
test <- read_csv("test.txt", header=FALSE)
All observations turn into 1 row, no separation between commas.
I am learning this package so any help would be great.
"dev_id":"f8:f0:05:xx:db:xx","data":["dist":[7270,7269,7269,7275,7270,7271,7265,7270,7274,7267,7271,7271,7266,7263,7268,7271,7266,7265,7270,7268,7264,7270,7261,7260],"temp":0,"hum":0,"vin":448],"time":4485318,"transmit_time":4495658,"version":"1.0"
"dev_id":"f8:xx:05:xx:d9:xx","data":["dist":[6869,6868,6867,6871,6866,6867,6863,6865,6868,6869,6868,6860,6865,6866,6870,6861,6865,6868,6866,6864,6866,6866,6865,6872],"temp":0,"hum":0,"vin":449],"time":4405316,"transmit_time":4413715,"version":"1.0"
"dev_id":"xx:f0:05:e8:da:xx","data":["dist":[5775,5775,5777,5772,5777,5770,5779,5773,5776,5777,5772,5768,5782,5772,5765,5770,5770,5767,5767,5777,5766,5763,5773,5776],"temp":0,"hum":0,"vin":447],"time":4461316,"transmit_time":4473307,"version":"1.0"
"dev_id":"xx:f0:xx:e8:xx:0a","data":["dist":[4358,4361,4355,4358,4359,4359,4361,4358,4359,4360,4360,4361,4361,4359,4359,4356,4357,4361,4359,4360,4358,4358,4362,4359],"temp":0,"hum":0,"vin":424],"time":5190320,"transmit_time":5198748,"version":"1.0"
r
I am trying to parse a text log file like this, I can use the default read.csv to parse this file.
test <- read.csv("test.txt", header=FALSE)
It separated all comma parts, though not perfectly put in a dataframe, further manipulation can be done to improve.
However, I can not seem to do so using readr package
test <- read_csv("test.txt", header=FALSE)
All observations turn into 1 row, no separation between commas.
I am learning this package so any help would be great.
"dev_id":"f8:f0:05:xx:db:xx","data":["dist":[7270,7269,7269,7275,7270,7271,7265,7270,7274,7267,7271,7271,7266,7263,7268,7271,7266,7265,7270,7268,7264,7270,7261,7260],"temp":0,"hum":0,"vin":448],"time":4485318,"transmit_time":4495658,"version":"1.0"
"dev_id":"f8:xx:05:xx:d9:xx","data":["dist":[6869,6868,6867,6871,6866,6867,6863,6865,6868,6869,6868,6860,6865,6866,6870,6861,6865,6868,6866,6864,6866,6866,6865,6872],"temp":0,"hum":0,"vin":449],"time":4405316,"transmit_time":4413715,"version":"1.0"
"dev_id":"xx:f0:05:e8:da:xx","data":["dist":[5775,5775,5777,5772,5777,5770,5779,5773,5776,5777,5772,5768,5782,5772,5765,5770,5770,5767,5767,5777,5766,5763,5773,5776],"temp":0,"hum":0,"vin":447],"time":4461316,"transmit_time":4473307,"version":"1.0"
"dev_id":"xx:f0:xx:e8:xx:0a","data":["dist":[4358,4361,4355,4358,4359,4359,4361,4358,4359,4360,4360,4361,4361,4359,4359,4356,4357,4361,4359,4360,4358,4358,4362,4359],"temp":0,"hum":0,"vin":424],"time":5190320,"transmit_time":5198748,"version":"1.0"
r
r
asked Mar 21 at 17:46
viet_datarviet_datar
1
1
2
Your sample data looks to be in JSON format. Trying using the` jsonlite` or similar package to parse the data.
– Dave2e
Mar 21 at 17:53
Thanks a lot for your info. I found it using ndjson::stream_in
– viet_datar
Mar 21 at 19:27
add a comment |
2
Your sample data looks to be in JSON format. Trying using the` jsonlite` or similar package to parse the data.
– Dave2e
Mar 21 at 17:53
Thanks a lot for your info. I found it using ndjson::stream_in
– viet_datar
Mar 21 at 19:27
2
2
Your sample data looks to be in JSON format. Trying using the` jsonlite` or similar package to parse the data.
– Dave2e
Mar 21 at 17:53
Your sample data looks to be in JSON format. Trying using the` jsonlite` or similar package to parse the data.
– Dave2e
Mar 21 at 17:53
Thanks a lot for your info. I found it using ndjson::stream_in
– viet_datar
Mar 21 at 19:27
Thanks a lot for your info. I found it using ndjson::stream_in
– viet_datar
Mar 21 at 19:27
add a comment |
1 Answer
1
active
oldest
votes
Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.
add a comment |
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286370%2fread-csv-does-not-work-separate-commas-and-not-capture-separate-rows%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.
add a comment |
Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.
add a comment |
Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.
Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.
answered Mar 21 at 19:30
viet_datarviet_datar
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286370%2fread-csv-does-not-work-separate-commas-and-not-capture-separate-rows%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown

2
Your sample data looks to be in JSON format. Trying using the` jsonlite` or similar package to parse the data.
– Dave2e
Mar 21 at 17:53
Thanks a lot for your info. I found it using ndjson::stream_in
– viet_datar
Mar 21 at 19:27