Code Monkey home page Code Monkey logo

Comments (9)

tkellen avatar tkellen commented on September 28, 2024

This is on node v0.10.26, btw.

from csv2array.

olalonde avatar olalonde commented on September 28, 2024

Weird, maybe I should have tested a little bit. Looking into it...

from csv2array.

olalonde avatar olalonde commented on September 28, 2024

Should be fixed now.. update to latest version.

from csv2array.

tkellen avatar tkellen commented on September 28, 2024

Not quite there yet:

"r1c1", "r1c2"
"r2c1", "r2c2"

Produces:

[ [ 'r1c1', ' "r1c2"' ],
  [ 'r2c1', ' "r2c2"' ] ]

from csv2array.

olalonde avatar olalonde commented on September 28, 2024

I've tried parsing your csv with a couple of parsers and they all seem to not handle it properly because of the spaces... What code produced that CSV? Are you sure it is valid?

from csv2array.

olalonde avatar olalonde commented on September 28, 2024

According to https://code.google.com/p/jquery-csv/issues/detail?id=21

"According to the CSV spec, whitespace contained outside of a proper delimiter is considered illegal."

from csv2array.

tkellen avatar tkellen commented on September 28, 2024

I wrote it by hand for a test case on rechoir (for eventual use within grunt, gulp etc via liftoff). You're correct, this is an invalid CSV format. We're all good here!

from csv2array.

tkellen avatar tkellen commented on September 28, 2024

ps: thanks!

from csv2array.

olalonde avatar olalonde commented on September 28, 2024

Ok, by the way, I've added a skipwhitespace option which seems to work for your csv data but I haven't tested it much.

csv2array(str, { skipwhitespace: true });

from csv2array.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.