-
Notifications
You must be signed in to change notification settings - Fork 217
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
clean-whitespace verb has no effect when followed by put verb #1461
Comments
In your file, all cells are strings, because you have those spaces. Then you should force to set all to strings:
to get
|
To run your put verb
|
Hi @aborruso Thank you |
If you run the command in one shot, without exit from it, for miller those fields that contain spaces are strings. If you run
you get
If exit from it and pass the cleaned output via stdout again to mlr, those strings have become numbers and so everything works. |
Thank you for the detailed answer. Now I understand. But this behaviour is not documented in the documentations. As a beginner I spent 5 hours to narrow down the issue to clean-whitespace and put command. |
I generally, when I work with CSVs, which is a format with so many flaws, the first thing I do is normalize them. So, with a file like that I usually first apply stand-alone clean-whitespace. I, for example, did not realize that only the "a" field was without spaces and I was making casting errors. |
If now this issue is ok for you, please close it |
Yes, it's clear for me, thanks to your explanation. But I suspect this would be clear for new users. Probably, before closing the issue one should clarify this in the documentation or probably provide a way to force |
You could open a PR to propose a change in the documentation. |
@OpenFoam-User @aborruso there's a bit more going on here.
I agree that at very least this needs some documentation -- however, I'm not sure that's enough. I'll think on this a bit. |
Of the two suggestions above, namely:
I think the first one is perhaps too disruptive. I think that if I were starting afresh, this might be the best option. However, I suspect (without proof or data) such a change might break existing scripts and/or expectations for people. The second one seems elegant and is implemented in PR #1464. |
Perfect! I have tried the PR on the test file above, and it works as expected. Many thanks |
A personal note. I think Miller is really fantastic for these reasons:
|
Hello,
Here is a csv file that contains one space after each comma:
If I use the following command:
I get error in the new column
f
as shown below:However, if I manually remove the space after each comma manually from the file it works. Or if I use two miller commands as follows:
Is this a bug?
The text was updated successfully, but these errors were encountered: