Name | Description |
---|---|
original | The original input file will be routed to this destination when the lines have been successfully routed to 1 or more relationships |
unmatched | Data that does not satisfy the required user-defined rules will be routed to this Relationship |
A Dynamic Relationship may be created based on how the user configures the Processor.
Name | Description |
---|---|
Name from Dynamic Property | FlowFiles that match the Dynamic Property's value |
Name | Description |
---|---|
RouteText.Route | The name of the relationship to which the FlowFile was routed. |
RouteText.Group | The value captured by all capturing groups in the 'Grouping Regular Expression' property. If this property is not set or contains no capturing groups, this attribute will not be added. |
Drop blank or empty lines from the FlowFile's content.
"Routing Strategy" = "Route to each matching Property Name"
"Matching Strategy" = "Matches Regular Expression"
"Empty Line" = "^$"
Auto-terminate the "Empty Line" relationship.
Connect the "unmatched" relationship to the next processor in your flow.
Remove specific lines of text from a file, such as those containing a specific word or having a line length over some threshold.
"Routing Strategy" = "Route to each matching Property Name"
"Matching Strategy" = "Satisfies Expression"
An additional property should be added named "Filter Out." The value should be a NiFi Expression Language Expression that can refer to two variables (in addition to FlowFile attributes): line
, which is the line of text being evaluated; and lineNo
, which is the line number in the file (starting with 1). The Expression should return true
for any line that should be dropped.
For example, to remove any line that starts with a # symbol, we can set "Filter Out" to ${line:startsWith("#")}
.
We could also remove the first 2 lines of text by setting "Filter Out" to ${lineNo:le(2)}
. Note that we use the le
function because we want lines numbers less than or equal to 2
, since the line index is 1-based.
Auto-terminate the "Filter Out" relationship.
Connect the "unmatched" relationship to the next processor in your flow.