Code Monkey home page Code Monkey logo

Comments (2)

MarkPflug avatar MarkPflug commented on June 16, 2024

I'm considering how (and if) I'll fix this issue. The code the does line end detection is a bit tricky because of some optimizations. I don't want support for /r line ends to introduce a performance penalty for the more common cases. I expect that support for this would require explicitly stating that the file uses Mac line terminators, rather than automatically detecting them. In the meantime, you can work-around this by using the class in this gist: https://gist.github.com/MarkPflug/d524ddd50db171b302dcacb204ff86e2

You can use this class to "fix" the input to conform to the expected line ends:

TextReader reader = File.OpenText("macos.csv");
// wrap the text reader in an adapter that will swap out `/n` for `/r`
reader = new MacOSTextReader(reader);
var csvReader = CsvDataReader.Create(reader);

Oh, and I should mention... I haven't tested this, at all.

from sylvan.

MarkPflug avatar MarkPflug commented on June 16, 2024

I convinced myself that this should be supported. I just pushed 1.3.1 to nuget which allows '\r' newlines without any special configuration.

from sylvan.

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.