Given a pipe-delimited row:
ABC|123|pqr|cde|abc.txt|
I have to find 3rd pipe delimiter and remove the rest of the line.
Below is what the result should look like.
ABC|123|pqr|
How can I achieve this?
Given a pipe-delimited row:
ABC|123|pqr|cde|abc.txt|
I have to find 3rd pipe delimiter and remove the rest of the line.
Below is what the result should look like.
ABC|123|pqr|
How can I achieve this?
Search using below regex and it will capture the first three pipes into group(1):
^(.+?\|.+?\|.+?\|).*
And then replace it with the captured group.
\1