Code Monkey home page Code Monkey logo

Comments (3)

quinnj avatar quinnj commented on June 19, 2024 1

Sorry for the slow response here. @nickrobinson251, as I consider this, it seems to me that it's actually incorrect in our original stripwhitespace implementation to strip whitespace within quoted strings. Like, the point of quoting a string is you want to preserve what's inside, including whitespace.

I think I perhaps just got too over-eager in that first implementation and didn't realize that we're over-stripping. Does that make sense? Do we think there would still be a use-case for stripping the whitespace inside quotes? I guess there are sometimes cases where a csv writer just quotes everything and you might want to also be able to strip inside quotes, but that feels like an additional option we'd want to be opt-in, since you're electing to ignore stuff inside your quotes.

from parsers.jl.

quinnj avatar quinnj commented on June 19, 2024 1

Alright, PR is up (#112) to fix stripwhitespace to preserve whitespace inside quoted string, but also adds stripquoted to allow stripping inside quotes.

from parsers.jl.

nickrobinson251 avatar nickrobinson251 commented on June 19, 2024

Do we think there would still be a use-case for stripping the whitespace inside quotes? I guess there are sometimes cases where a csv writer just quotes everything and you might want to also be able to strip inside quotes, but that feels like an additional option we'd want to be opt-in, since you're electing to ignore stuff inside your quotes.

Yeah, unfortunately i have this use-case, so it does exist 😞

I agree stripping whitespace within quotes should be opt-in and not the default for what stripwhitespace does (unlike currently)

from parsers.jl.

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.