Giter VIP home page Giter VIP logo

Comments (7)

ColumPaget avatar ColumPaget commented on May 29, 2024

hmm, that seems strange to me, because that's adding a comma that's not there in the input! But if that's how gnu cut does it, then I guess it makes sense to fit in with that.

from columscut.

ColumPaget avatar ColumPaget commented on May 29, 2024

Oh, hang on, I misunderstood you. You're saying there shouldn't be one after eight in the 3rd line?

from columscut.

larrypl avatar larrypl commented on May 29, 2024

Sorry - exactly right. I wouldn't expect there to be a comma after “one eight” on the third line.

from columscut.

ColumPaget avatar ColumPaget commented on May 29, 2024

I've looked into this one, and I've got to say I think it's a feature not a bug! You asked for 9 fields, and you got nine fields, though the last one is a blank field because there's no matching data in the input. In fact this example:

echo 1,2,3,4 | ./ccut -d . -f 3,2,6,7

which outputs

3,2,

arguably should output:

3,2,,

from columscut.

larrypl avatar larrypl commented on May 29, 2024

Good point - I like it! That normalizes the input into fixed numbers of fields.

from columscut.

ColumPaget avatar ColumPaget commented on May 29, 2024

Okay, now I just have to make it actually do that, as the current version doesn't.

from columscut.

ColumPaget avatar ColumPaget commented on May 29, 2024

Okay, got this to work for release v2.10.

Pretty shocked to discover that gnu cut does this:

echo "1,2,3,4,5" | cut -d , -f 2,3,20,4,5
2,3,4,5

If you're using cut to extract fields into values (what else is it for?) you'll have the wrong things in the wrong boxes, if you see what I mean.

Anyways, gonna close this one now.

from columscut.

Related Issues (9)

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.