You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interesting corner case I haven't thought about. I'd be inclined to classify this as a bug.
get_args() is not smart enough in the case there are multiple files, and the list is terminated by a file (without a column-spec).
Edit:
Looking deeper, it seems hard to fix because cuts repeats the last arg (column or file) whenever there's no pairing and alows flexible order of parameters. This enables it to work as expected and minimize typing, in many cases like:
# column vs file order is flexible
cuts -1 f1 f2 f3
cuts f1 f2 f3 -1
and even
cuts f1 -1 f2 f2
All the above will print the last column of the files specified.
So in the corner case above what happens is 0 is paired with the file f1, and -1 is paired with f2.
Looks like I'll have to fix the documentation and help message.
Hi,
Perhaps I am misunderstanding how the cuts function works, but according to the documentation if one was to do this:
cuts f1 0 -1 f2
Should lead to 1st & last columns from f1 & last column (last colno seen) from f2.
But given these test data:
f1
a 10
b 12
c 14
f2
i 1
ii 2
iii 3
cuts f1 0 -1 f2
Produces
a 1
b 2
c 3
I thought it would produce
a 10 1
b 12 2
c 14 3
Is this expected? Or a bug?
The text was updated successfully, but these errors were encountered: