It still there on the FME hub
I posted this a long time ago, but it's not easily searchable and the code has been mangled while ported between the different versions of the forum software, so here's a slightly modified version of my original post.
You can insert the following code into a PythonCaller, it will read a string from the attribute "text_line_data" and wrap it at the position specified in a parameter "MaxWidth":
import fmeobjects import textwrap def TextWrapper(feature): text = feature.getAttribute("text_line_data") # modify as necessary maxLength = int(FME_MacroValues['MaxWidth']) parts = textwrap.wrap(text, maxLength) feature.setAttribute('number_of_parts', len(parts)) if parts: feature.setAttribute('parts{}', parts)
Expose the attributes "parts{}" and "number_of_parts" in the PythonCaller.
This outputs all parts to the list "parts{}", you can then use a ListExploder to get one feature per wrapped line, see attached sample workspace.
It seem you need "SubstringExtractor" transformer.