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

Short option for --nidx --fs tab #158

Closed
sjackman opened this issue Oct 17, 2017 · 11 comments
Closed

Short option for --nidx --fs tab #158

sjackman opened this issue Oct 17, 2017 · 11 comments

Comments

@sjackman
Copy link
Contributor

sjackman commented Oct 17, 2017

The TSV file format of cut and friends is sufficiently common that I feel that --nidx --fs tab warrants a short option, similar to -p, perhaps -t. It's particularly handy when using mlr to replace commands from coreutils, for example, mlr -t cut -f 3. Your thoughts?

I'd also suggest a short option for --tsvlite, perhaps -T.

@johnkerl
Copy link
Owner

Cool; mlr put already uses -t and -T but mlr main uses neither.

@sjackman
Copy link
Contributor Author

Awesome. Do you have a preference which of the two is -t and which is -T? Which format do you think is more common? I'd say that the more common one should be -t.

@johnkerl
Copy link
Owner

@sjackman i don't have a preference. --tsvlite = -T is fine with me.

@sjackman
Copy link
Contributor Author

I use --tsvlite more than I use --nidx --fs tab. I'm thinking
-t is --tsvlite and
-T is --nidx --fs tab

@sjackman
Copy link
Contributor Author

Woohoo! Thanks, John. New release pending?

@johnkerl
Copy link
Owner

Pretty soon ... I want to get the comment-skipper in there too and it needs a bunch of regression tests, and one more corner-case to implement.

@sjackman
Copy link
Contributor Author

sjackman commented Nov 18, 2017

Awesome. While you're doing the comment-skipper, I have a use case to pass all comments through unmodified to the output. Think that could make it in?

@johnkerl
Copy link
Owner

bler, i don't know how to do that within the miller streaming architecture ...

@sjackman
Copy link
Contributor Author

sjackman commented Nov 19, 2017

I was thinking as it's read in from the input, if it's a comment, immediately write that same line out to the output.

@johnkerl
Copy link
Owner

gler, that would be ok with line-at-a-time mappers but w sort etc it's not clear to me what would be the right thing to do.

@sjackman
Copy link
Contributor Author

Print the comment lines out in the order that they're observed. In the case of sort, the comment lines would appear before the normal records in the order that they're observed, which would be consistent with a stable sort where a comment line sorts before any other record. That happens to be the behaviour that I need. In my case, the comment lines all appear at the top of the file before the normal records.

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

2 participants