Tap sink = getPlatform().getTextFile( new Fields( "line" ), getOutputPath( "formatter" ), SinkMode.REPLACE );
Pipe pipe = new Pipe( "formatter" );
pipe = new Each( pipe, new Fields( "line" ), new RegexSplitter( new Fields( "a", "b" ), "\\s" ) );
pipe = new Each( pipe, new FieldFormatter( new Fields( "result" ), "%s and %s" ) );
Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
flow.complete();