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

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

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

View solution in original post


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

View solution in original post

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now