Examples of using Extract text action
- Updated: 2022/10/10
Examples of using Extract text action
The Extract text action enables you to extract text from a source string. You can extract text that occurs in the range of 1 to 999999 times in a file before, after, or between two strings.
Before option
This option enables you to extract the entire text followed by the value you have provided in the Start after text field. You can also extract the text based on the occurrence of the value you have provided in the field.
For example, a:123a:123b:123c:
is the source string, you can specify
: in the Start after text field
and 2 in the Occurrence field to
extract the string followed by the second occurrence of : in
the source string. In this example, the extracted text is
123b:123c:
.
After option
For example, a:123a:123b:123c:
is the source string, you can specify
: in the End before text field and
3 in the Occurrence field to
extract the string preceding the third occurrence of
: in the source string. In this example, the extracted
text is a:123a:123b
.
Before and/or after option
This option enables you to extract the text between the values you have provided in the Start after text and the End before text fields. You can also apply the AND or OR logical operator. You can select the AND operator to extract text only when both conditions specified for the Before and After options are satisfied. Otherwise, you can select the OR operator to extract text only when either of the conditions specified for the Before or the After option is satisfied.
For example, a:123a:123b:123c:
is the source string, you can specify
: in the Start after text and
End before text fields and 2 in
the Occurrence fields to extract the string after the second
and before the fourth occurrence of : in the source string.
In this example, the extracted text is 123b:123c
.