SplitText 2.0.0

Bundle
org.apache.nifi | nifi-standard-nar
Description
Splits a text file into multiple smaller text files on line boundaries limited by maximum number of lines or total size of fragment. Each output split file will contain no more than the configured number of lines or bytes. If both Line Split Count and Maximum Fragment Size are specified, the split occurs at whichever limit is reached first. If the first line of a fragment exceeds the Maximum Fragment Size, that line will be output in a single split file which exceeds the configured maximum size limit. This component also allows one to specify that each split should include a header lines. Header lines can be computed by either specifying the amount of lines that should constitute a header or by using header marker to match against the read lines. If such match happens then the corresponding line will be treated as header. Keep in mind that upon the first failure of header marker match, no more matches will be performed and the rest of the data will be parsed as regular lines for a given split. If after computation of the header there are no more data, the resulting split will consists of only header lines.
Tags
split, text
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
Properties
System Resource Considerations
Resource Description
MEMORY The FlowFile with its attributes is stored in memory, not the content of the FlowFile. If many splits are generated due to the size of the content, or how the content is configured to be split, a two-phase approach may be necessary to avoid excessive use of memory.
Relationships
Name Description
original The original input file will be routed to this destination when it has been successfully split into 1 or more files
splits The split files will be routed to this destination when an input file is successfully split into 1 or more split files
failure If a file cannot be split for some reason, the original file will be routed to this destination and nothing will be routed elsewhere
Writes Attributes
Name Description
text.line.count The number of lines of text from the original FlowFile that were copied to this FlowFile
fragment.size The number of bytes from the original FlowFile that were copied to this FlowFile, including header, if applicable, which is duplicated in each split FlowFile
fragment.identifier All split FlowFiles produced from the same parent FlowFile will have the same randomly generated UUID added for this attribute
fragment.index A one-up number that indicates the ordering of the split FlowFiles that were created from a single parent FlowFile
fragment.count The number of split FlowFiles generated from the parent FlowFile
segment.original.filename The filename of the parent FlowFile
See Also