One Star

[resolved] tSCPFileList global variable to print out list of directories to flow?

Hello,

I am trying to obtain a list of directories via SCP.  Here is my current setup:

tSCPConnection
     |
     |
(On SubJob OK)
     |
tSCPFileList  ---- (Iterate) ----  tJava



On tSCPFileList I have: command separator = ; 
and under File List I have these two:

"cd /var/www/bi.ourcompany.com/public/webalizer/"
"ls -1"



on tJava I have (I know some of these won't work but I thought I'd try anyway.)

System.out.println("CURRENT_LINE: " + ((String)globalMap.get("tSCPFileList_1.CURRENT_LINE")) );
System.out.println("ERROR_MESSAGE: " + ((String)globalMap.get("tSCPFileList_1.ERROR_MESSAGE")) );
System.out.println("NB_LINE: " + ((String)globalMap.get("tSCPFileList_1.NB_LINE")) );
System.out.println("STATUS: " + ((String)globalMap.get("tSCPFileList_1.STATUS")) );
System.out.println("test below");
System.out.println("FILE: " + ((String)globalMap.get("tSCPFileList_1.CURRENT_FILE")) );
System.out.println("DIRECORY: " + ((String)globalMap.get("tSCPFileList_1.CURRENT_FILEDIRECTORY")) );
System.out.println("PATH: " + ((String)globalMap.get("tSCPFileList_1.CURRENT_FILEPATH")) );



My expected result should show me a list of all directories in the folder, such as:

 website1.com/
 website2.com/
 website3.com/
 website4.com/



l can see that talend is reading the correct number of rows (directories) inside the folder however the result is all null for variable attempts for all given rows (example):

CURRENT_LINE: null
ERROR_MESSAGE: null
NB_LINE: null
STATUS: null
test below
FILE: null
DIRECORY: null
PATH: null
CURRENT_LINE: null
ERROR_MESSAGE: null
NB_LINE: null
STATUS: null
test below
FILE: null
DIRECORY: null
PATH: null
etc...
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] tSCPFileList global variable to print out list of directories to flow?

I found a solution.
tSSH -----tNormalize----tLogRow
I used the same settings and commands in tSSH component.  On TSSH, I used standard output to normal and then on tNormalize I normalized the 1 output row into several rows for consumption (item separator "\n").
1 REPLY
One Star

Re: [resolved] tSCPFileList global variable to print out list of directories to flow?

I found a solution.
tSSH -----tNormalize----tLogRow
I used the same settings and commands in tSSH component.  On TSSH, I used standard output to normal and then on tNormalize I normalized the 1 output row into several rows for consumption (item separator "\n").