-
I have CSVs like this
Now I want to add a better header name for the last column, if it hasn't a good header name yet. I do this with
This works - but only when the 3rd column exists. An input file like
gives me the error "mlr: conditional expression did not evaluate to boolean." So how can I check that the 3rd column exists before I check for its header value? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
It could be useful the
you will have a good result for both your examples. |
Beta Was this translation helpful? Give feedback.
-
A note. In this
the third field does not exist. Instead here
it exists. it has no label, but it exists. |
Beta Was this translation helpful? Give feedback.
-
@halloleo I'm cloning a reply to map a "right" answer. To check for column existence in the DSL, you could use
|
Beta Was this translation helpful? Give feedback.
@halloleo I'm cloning a reply to map a "right" answer.
To check for column existence in the DSL, you could use
is_present
function: