Passing row separator as context value

Six Stars

Passing row separator as context value

Hi All,

 

I am unable to pass new line character (\n) as context value for field "Row Separator" to tFileInputDelimited component.

 

Community Manager

Re: Passing row separator as context value

Can you show us a screenshot of your job and let us know what happens when you run it? This could be caused by a couple of things. We need more info.

Highlighted
Six Stars

Re: Passing row separator as context value

 

Below you can see I have declared Row Separator as context.IF_Row_seperator and in second snapshot passing that value as \n

 

Capture1.PNGCapture2.PNG

Community Manager

Re: Passing row separator as context value

I actually meant to show your job layout as well, but this gives me a clue. I suspect that the file you are loading is having it's escape character (/) escaped to make it behave as a literal. Try this, at the beginning of your job (or after your context file has been loaded), add a tJava and set your context variable there like below...

 

context.IF_Field_Separator="\n";

 Then run your job. If that works, my suspicions are correct. This will have been done for good reasons, so I am not sure it is a bug. 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads