-
Notifications
You must be signed in to change notification settings - Fork 220
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
Ignore empty fields while joining #1194
Comments
You have empty values in id field and you use it to make the join, then you will have it in join standard output. But you can add the filter verb, and remove all records in which id is null
And you get
|
But then how could I use other
should give:
|
I'm sorry, probably I don't understand what your goal is. Could you add the sample output you want, starting from the example input? Thank you |
Sorry, maybe I was not clear, but my goal would be to join to CSV files treating empty fields differently. As I see it, right now, empty fields are treated as a normal string, just empty. I was wondering if it would be possible to treat them as "unknown" values (i.e. NA), in a way that the user could decide how to deal with them: either they never match anything (not even other empty fields) or that they always match. An example of the first case would be the one on my previous comment: empty fields are not matched but kept from the left file. |
Once again, probably, I don't understand what your goal is. And once again I'm sorry. If you run a standard join, by id, Miller joins also the empty cells. You have 2 nulls rows in the left and 2 nulls rows in the right, then in the join output you have 2x2=4 rows
If you want to add
and you get
But I think I didn't answer you :( |
If you run
you get
|
I am trying to treat empty strings as missing data, meaning that they are ignored when matching. For example: ==> color-codes.csv <==
==> color-names.csv <==
I'd like (order is not relevant):
or:
|
ok, this is not a join. I think you should create a for loop Miller script |
@fgvieira sorry for the delay in replying. This can be done by the creation of some new flags for the |
Oops wrong issue sorry! |
Dear all,
I've only recently came across Miller but it is quite impressive!
However, I am now trying to join two CSV files by a column but would like to ignore empty fields. For example:
Joining on color the results are as expected:
Is this possible?
thanks,
The text was updated successfully, but these errors were encountered: