Skip to content

How to find if a field is contained in another field with Asterix '*' #1177

Answered by aborruso
ondohotola asked this question in Q&A
Discussion options

You must be logged in to vote

I have add a great suggestion in stack overflow from Kusalananda: to use ssub function, no regexing, no characters are special:

mlr --csv filter '$b != ssub($b,$a,"")' input.csv

if($b != ssub($b,$a,"")), if after string replace b is not equal to itself, then a is contained in b.

Replies: 6 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@ondohotola
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ondohotola
Comment options

You must be logged in to vote
1 reply
@aborruso
Comment options

Comment options

You must be logged in to vote
1 reply
@aborruso
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants