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










0















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"











share|improve this question

















  • 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















0















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"











share|improve this question

















  • 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













0












0








0








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"











share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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












1 Answer
1






active

oldest

votes


















0














Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.






share|improve this answer























    Your Answer






    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.






    share|improve this answer



























      0














      Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.






      share|improve this answer

























        0












        0








        0







        Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.






        share|improve this answer













        Thanks to @Dave2e pointing out that this file is in JSON format, I found the way to parse it using ndjson::stream_in.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 21 at 19:30









        viet_datarviet_datar

        1




        1





























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

            Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?