CR/LF and removing extra ones

One Star

CR/LF and removing extra ones

Any know the best way of removing cr/lf or just lf from a string ?
My file looks like this;

I'd like to get to;
Seven Stars

Re: CR/LF and removing extra ones

I think you need to read the file using tFileInputDelimited with CSV options and then use tJavaRow to remove the linefeeds.
If the linefeed is always in the same field, just use e.g. output_row.field3 = input_row.field3.replace("\\r\\n\r\n","");
If you don't know which field has the linefeed or it can change from row to row, you'll have to use reflection to loop through all the fields doing the replace. I've never used reflection myself, having only very basic Java knowledge but this topic ( should help you hopefully.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach


Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.



Introduction to Talend Open Studio for Data Integration.