Your answer will probably need to be broken into two parts
- How to do a regex search in KNIME
- How to do a regex search for the 6th line
I can help with the regex search, but I don't know KNIME
To start with, you want to know how to search for a single line which is
([^\n]*\n)
This looks for
*: 0 or more
of
[^\n]: anything that isn't a new line
- followed by
\n: a new line
- and
(): groups them together into a single match
We can then expand this into: ([^\n]*\n){5}([^\n]*\n){1}
Which creates 2 capture groups, one with the first 5 lines, the second with the 6th line.
If KNIME supports Non-Capturing groups you can then expand that into the following so that you only have one matching capture group. You can decide for yourself which you like best.
(?:[^\n]*\n){5}([^\n]*\n){1}
I've created an example you can test on RegExr
Regardless of which way you go, make sure to document the regex with comments or stick it into a variable with a very clear name since they aren't particularly human readable