Coder Social home page Coder Social logo

Comments (4)

akamor avatar akamor commented on June 26, 2024 1

And also, in case we dont talk again let me say thanks a lot for your support of csv helper. were huge fans.

from csvhelper.

JoshClose avatar JoshClose commented on June 26, 2024

That's not a valid CSV file.

You can handle this by setting the trim option TrimOptions = TrimOptions.Trim

from csvhelper.

akamor avatar akamor commented on June 26, 2024

Got it. I suspected that was the situation but thanks for confirming.

I've noticed that Excel seems to almost always open CSVs (even invalid ones). For whatever reason, it is just very relaxed in the set of inputs it can accept. Is there any documentation on the collection of config options we should employ via your SDK to essentially accept even malformed csvs, or said another way how can we replicate excel's behavior?

from csvhelper.

JoshClose avatar JoshClose commented on June 26, 2024

There is no set of things. Typically, you want to know when things aren't working as expected.

Setting TrimOptions = TrimOptions.Trim | TrimOptions.InsideQuotes should be pretty safe. You can set what is trimmed via the WhiteSpaceChars setting. By default it's just a space character.

You can change the behavior of BadDataFound to just ignore the issue with BadDataFound = null, but depending on the reason, it could mess up the rest of the read. You might want to log when this happens or something.

from csvhelper.

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.