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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[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...
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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").

View solution in original post

1 Reply
Anonymous
Not applicable
Author

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").