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

Is it possible to join using stdin? #305

Open
aborruso opened this issue Jan 26, 2020 · 2 comments
Open

Is it possible to join using stdin? #305

aborruso opened this issue Jan 26, 2020 · 2 comments

Comments

@aborruso
Copy link
Contributor

Hi,
in the join command it's mandatory to set -f, then to set a filename.

Is it possible to do something like:

<input do something | mlr --csv join -j id  -f stdin anotherFile

And is it possible to do something like this (apply a Miller verb before joining):

mlr --csv millerVerb file1 then join -j id -f millerVerbOutput anotherFile

Thank you

@johnkerl
Copy link
Owner

First one: currently it's not but I can look into it. I'd need to error out immediately if the command line specifies main input from stdin and join input from stdin, but, other than that it should work (with some code changes). Oh also, risk of confusion if one does two joins both taking input from stdin -- behavior would be weird.

As for the second: yes you can do that but file1 needs to go at the end.

http://johnkerl.org/miller/doc/cookbook.html#Doing_multiple_joins

@johnkerl johnkerl removed the active label Jan 1, 2022
@laixintao
Copy link

@aborruso I figured out a workaround.

you can use the proc system, like this mlr --icsv --ojson tail -n 2 /proc/self/fd/0

https://xbin.io/w/tool/mlr

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