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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using context variable for delimiter in tfileinputdelimited

Hi,

As per the requirement, we are supposed to give a context variable in the place of delimiter and substitute the value "," in the context file.

Hence, in tinputfiledelimited I gave "context.delimiter" at the delimiter textbox and in the context file;  i gave delimiter,,

(the file is comma delimiter). I encountered error, also i tried giving

delimiter,","

I encountered error as well, can some provide me a solution on how to provide a context variable for a delimiter whose delimited value is ,

 

This is the error, I get while trying to execute the file with the context value as stated above.

Exception in component tfileinputdelimited_1

java.lang.IllegalArgumentException: Field Separator must be assigned a char.

 

Please advice me how to put the context variable in the context file so as to handle "," delimiter file in tinputfiledelimited.

Labels (1)
3 Replies
Jesperrekuh
Specialist
Specialist

Use single quote : ','

Anonymous
Not applicable
Author

Thanks for the reply,

Do you mean to put the context file as below?

 

ctxtdelimiter,',' 

(where ctxtdelimiter is the context variable for delimiter) and in the delimiter place (in tfileinputdelimiter_1) use context.ctxtdelimter in the place of delimiter text box

 

is my understanding correct?

Jesperrekuh
Specialist
Specialist


in the contex change from String -> Character and set it ',' which is a character...

Also you could keep it as a String and simply use double quotes

So both worked, 

 

Make sure in tFileInputDelimited just use  

""+context.delimitvar

 

without ""+ it raises an error. I think a bug exists, I dont know why...