Description:

Splits a text file into multiple smaller text files on line boundaries, each having up to a configured number of lines

Tags:

split, text

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values.

NameDefault ValueAllowable ValuesDescription
Line Split CountThe number of lines that will be added to each split file
Header Line Count0The number of lines that should be considered part of the header; the header lines will be duplicated to all split files
Remove Trailing Newlinestrue
  • true
  • false
Whether to remove newlines at the end of each split file. This should be false if you intend to merge the split files later

Relationships:

NameDescription
originalThe original input file will be routed to this destination when it has been successfully split into 1 or more files
failureIf a file cannot be split for some reason, the original file will be routed to this destination and nothing will be routed elsewhere
splitsThe split files will be routed to this destination when an input file is successfully split into 1 or more split files

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
text.line.countThe number of lines of text from the original FlowFile that were copied to this FlowFile
fragment.identifierAll split FlowFiles produced from the same parent FlowFile will have the same randomly generated UUID added for this attribute
fragment.indexA one-up number that indicates the ordering of the split FlowFiles that were created from a single parent FlowFile
fragment.countThe number of split FlowFiles generated from the parent FlowFile
segment.original.filename The filename of the parent FlowFile

See Also:

MergeContent