Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
shivanand
Contributor III
Contributor III

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.

 

Labels (1)
6 Replies
Anonymous
Not applicable

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.

shivanand
Contributor III
Contributor III
Author

 

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

 

0683p000009Lrxw.png0683p000009Lrnx.png

Anonymous
Not applicable

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. 

Talend_ent
Contributor III
Contributor III

Could someone clear my error, when I'm  passing the context variable to Header Field in tfileinputDelimited component it throwing following error..

 


Error_msg.PNG
Anonymous
Not applicable

@Talend_enthu, it is a compilation error, just made a simple testing with v7.3.1 and it works, I set the Header field as context.varName.
BTW, please insert your images into post body instead of attaching them.

Regards
Shong
Talend_ent
Contributor III
Contributor III

0683p000009Ma4g.png0683p000009MaF9.png