Comments (7)
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.
Oh, hang on, I misunderstood you. You're saying there shouldn't be one after eight in the 3rd line?
from columscut.
Sorry - exactly right. I wouldn't expect there to be a comma after “one eight” on the third line.
from columscut.
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.
Good point - I like it! That normalizes the input into fixed numbers of fields.
from columscut.
Okay, now I just have to make it actually do that, as the current version doesn't.
from columscut.
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)
- Bashslash for a delimiter doesn't work? HOT 5
- Should reverse field ranges work? HOT 2
- Off-by-one error caused by backslash in delimstr? HOT 4
- Should argument parsing ignore spacing? HOT 6
- Feature Request: output array (and bug - extra blank line?) HOT 7
- Now that reverse ranges are an option, delimiters get misplaced HOT 5
- “(null)” in output HOT 3
- The -s / --only-delimited option seems to not work as expected HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from columscut.