Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csvtk unselect range error #234

Closed
tolot27 opened this issue Jul 12, 2023 · 2 comments
Closed

csvtk unselect range error #234

tolot27 opened this issue Jul 12, 2023 · 2 comments

Comments

@tolot27
Copy link

tolot27 commented Jul 12, 2023

The range selector to "discard 1st to 3rd column" does not work as documented:

echo -e "1,2,3,4,5" | csvtk -H cut -f -1--3
[ERRO] invalid field range: -1--3. start (-1) should be less than end (-3)

It does not matter which numbers are used. It looks like the first dash is treated as the "minus" of the first number rather than as the unselect operater.

Both version 0.25 and 0.26 are affected.

@avilella
Copy link

avilella commented Jul 12, 2023 via email

shenwei356 added a commit that referenced this issue Jul 12, 2023
@shenwei356
Copy link
Owner

Oh, both ways are supported now.

$ echo -e "1,2,3,4,5" | csvtk -H cut -f -1--3
4,5
$ echo -e "1,2,3,4,5" | csvtk -H cut -f -3--1
4,5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants