[resolved] Unable to use context variable in tSCPList

One Star

[resolved] Unable to use context variable in tSCPList

Hi,
I'm trying to pick out specific files from a Unix directory using tSCPList and tSCPGet components
I'm able to get the required file if the name is typed in explicity
eg: "find /opt/net/tmfrge/var/filestore/ -name '*witi298c782b8196b9dea1e09a8b'"
However, for my requiremnt, the filename will be dynamic - sourced from a database.
The code is:
tMySQLinput ->tFlowToIterate ->tJava ->tSCPFileList ->tSCPGet
In the tJava, the required filename is being set to a context variable so that it can be used in the command as below:
"find /opt/net/tmfrge/var/filestore/ -name  'context.raw_file_id'"
where:
context.raw_file_id="*"+((String)globalMap.get("row3.rawfileid"));
An example of context.raw_file_id printed in the tJava is *witi298c782b8196b9dea1e09a8b
When the context variable is given in the command, the the job executes but does not get any file.I've tried using '+context.raw_file_id+','$context.raw_file_id' but none of them seem to work.
Am I missing something in the syntax of the context variable or is this not supported? I'm using Talend Open studio for Big Data(6.0.0.20150702_1326)
Please help.

Accepted Solutions
One Star

Re: [resolved] Unable to use context variable in tSCPList

Hi All,
Figured out a syntax error:
it should be :"find /opt/net/tmfrge/var/filestore/ -name "+context.raw_file_id+""
This will let the value from the context variable to be read.
It is resolved.
Thanks.

All Replies
One Star

Re: [resolved] Unable to use context variable in tSCPList

Hi All,
Figured out a syntax error:
it should be :"find /opt/net/tmfrge/var/filestore/ -name "+context.raw_file_id+""
This will let the value from the context variable to be read.
It is resolved.
Thanks.