Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Spliting a multi-line input message into many rows.

Sorry for what is probably a very noob question.

I've an input message whose body is a multi-line data file, this is routed to a Talend Job, being received as a single String by tRouteInput.

When I pass this to tLogRow is it processed as a single row.

What I want to do is break this row into a sinlee row per line of the input message, but I can't find any components that will do this, so I think I must be missing something very simple.

 

Thanks for any suggestions!

 

Screwtape.

Labels (3)
2 Replies
TRF
Champion II
Champion II

Hi,

Push this string into a temporary file then read the file tFileInputFullRow to get the content line by line.

Hope this helps.

Anonymous
Not applicable
Author

Inspired by a slightly different solution I found on the the web for duplicating records, I have gone with a tJavaFlex solution, where I break the string into lines and iterate each line. It's not quite kosher, but it works:

 

Main Code:

for ( String strRow : row2.body.split( "\r?\n" ) ) {
	row3.body = strRow;

End Code:

}

I suspect I should increment some counters somewhere to make this a more complete solution, but it will do for now.