Giter Site home page Giter Site logo

String parse error about jquery-csv HOT 3 CLOSED

evanplaice avatar evanplaice commented on July 29, 2024
String parse error

from jquery-csv.

Comments (3)

evanplaice avatar evanplaice commented on July 29, 2024

From [email protected] on December 26, 2012 23:34:26

Not surprising, your input contains illegal data.

According to the CSV spec, whitespace contained outside of a proper delimiter is considered illegal. Come to think of it, I could probably improve the error handling to explain as much.

So for:

"School", "1601-1643 E Pythian St"

The space denoted by # is causing your issue:

"School",#"1601-1643 E Pythian St"

Note: The error clearly explains the issue. The first illegal instance is found in the second value of the first row.

It's an easy fix by hand but if you have a large data set with 'whitespace issues' it might be easher/quicker to write a preprocessor to handle the cleanup.

If that's what you need, let me know and I'll consider it as a new feature request. I doubt you'll be the last person who has this issue so it's within the best interest of the project to provide a solution.

If you'd like to write one yourself I can help too. I need to first add the preParse() callbacks but the rest can be handled by a single hook function. In fact, it shouldn't take a lot of effort to adapt the $.csv.parsers.splitLines() to accomplish what you're asking.

Let me know the approach you'd like to take.

Status: Invalid
Owner: [email protected]
Labels: -Priority-Medium Priority-Low

from jquery-csv.

evanplaice avatar evanplaice commented on July 29, 2024

From [email protected] on December 27, 2012 06:58:19

I know that [space] create problems, but we know that if column contain [space] he will be wrapped with "" this mean that ',[space]' or '[space],' also must be accepted as delimiter and in my case are very easy to fix this. otherwise let consider it as a new feature request. I like it and don't have any pretensions.

from jquery-csv.

evanplaice avatar evanplaice commented on July 29, 2024

From [email protected] on January 24, 2013 20:28:50

Consider this an accepted feature request.

I'm not exactly sure how to merge issues but you can follow the development on Issue 22 .

from jquery-csv.

Related Issues (20)

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.