Five Stars

Problem in tFileList and tFileProperties

I am trying to get tFileProperties through itration of tFileList and getting result in tLogRow. when I get properties of single file its OK and I can see properties in tLogRow but when processing through ((String)globalMap.get("tFTPFileList_1_CURRENT_FILE")) of tFileList it is showing null values in output of all individual files as shown below:

.--------+-------+--------+-----------+----+-----+------------.
| tLogRow_2 |
|=-------+-------+--------+-----------+----+-----+-----------=|
|abs_path|dirname|basename|mode_string|size|mtime|mtime_string|
|=-------+-------+--------+-----------+----+-----+-----------=|
|null |null |null |null |null|null |null |
'--------+-------+--------+-----------+----+-----+------------'
.--------+-------+--------+-----------+----+-----+------------.
| tLogRow_2 |
|=-------+-------+--------+-----------+----+-----+-----------=|
|abs_path|dirname|basename|mode_string|size|mtime|mtime_string|
|=-------+-------+--------+-----------+----+-----+-----------=|
|null |null |null |null |null|null |null |
'--------+-------+--------+-----------+----+-----+------------'

Below is job details:

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Forteen Stars

Re: Problem in tFileList and tFileProperties

Did you try my last suggestion? What you have done with a single file is hard code JUST the filename in the file field. In your previous version you were supplying the filepath AND filename in the file field. My last post showed you what to change I believe.

Rilhia Solutions
11 REPLIES
Ten Stars

Re: Problem in tFileList and tFileProperties

Can you share the preoperties of tFileList and tFileProperties? i was thinkng that the pattren of file in tFileList

Manohar B
Highlighted
Forteen Stars

Re: Problem in tFileList and tFileProperties

I don't believe the tFileProperties will have access to the filenames returned by your tFTPFileList. Are you meaning to be using that component or did you mean to use the tFileList? If you are looking at files in an FTP location use the tFTPFileProperties.

Rilhia Solutions
Six Stars

Re: Problem in tFileList and tFileProperties

Hi ,

 

Instead of using "tFileProperties" use "tFTPFileProperties" component in your job flow. 

Thanks & Regards
A Ravi Kumar
Mobile Number : +91 852-762-1083
Email-id : a.ravikumar104@gmail.com
Skype Id : ammanannaravikumar
Five Stars

Re: Problem in tFileList and tFileProperties

I have changed tFileProperties to tFTPFileProperties as shown below with properties but result is same.

Capture.PNGCapture.PNG

Ten Stars

Re: Problem in tFileList and tFileProperties

Since do you have the same kind of files starting with "*uplink*" in ftp location ?,the filemask is case sensitive.

Manohar B
Forteen Stars

Re: Problem in tFileList and tFileProperties

You have hardcoded your Remote Directory and then used the CURRENT_FILEPATH globalMap value to point to the file. Have you tried the CURRENT_FILE globalMap value? You only want to name the file and not provide the complete url. Also, are your sure that your username and password do not take you straight to the path you have specified in your Remote Directory? Basically I think you are not actually pointing at the file.

Rilhia Solutions
Five Stars

Re: Problem in tFileList and tFileProperties

I am trying to understand your answer but at the same time attached is the text file with output of job which shows there is no problem with credentials because file names and path is successfully parsed. But same path and file name present in tFilelist should be parsed by fileproperties for its values and shown in tLogRow.

Can you explain little bit more where am I doing wrong and what should be the actual way of doing same.

Forteen Stars

Re: Problem in tFileList and tFileProperties

Basically can you try this code for the file name in your tFTPFileProperties....

 

((String)globalMap.get("tFTPFileList_1_CURRENT_FILE"))
Rilhia Solutions
Five Stars

Re: Problem in tFileList and tFileProperties

I have repeated the same process with single file mentioning its name in the file name and its successful as shown below and attached in the text file but I am not able to develop the logic to get the same list of files in the same folder.

Capture.PNG

Forteen Stars

Re: Problem in tFileList and tFileProperties

Did you try my last suggestion? What you have done with a single file is hard code JUST the filename in the file field. In your previous version you were supplying the filepath AND filename in the file field. My last post showed you what to change I believe.

Rilhia Solutions
Five Stars

Re: Problem in tFileList and tFileProperties

I simply attached tFTPFillelist again and changed single file with ((String)globalMap.get("tFTPFileList_1_CURRENT_FILE")) it worked very well as shown below: thank you for providing the guideline its great Smiley Happy

+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| key | value |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| abs_path | /export/home/sysm/opt/oss/server/var/fileint/pm/pmexport_20180315/pmresult_1275071424_60_201803151200_201803151300_UFM Assignment MEasurement (Per Cell).csv |
| dirname | /export/home/sysm/opt/oss/server/var/fileint/pm/pmexport_20180315 |
| basename | pmresult_1275071424_60_201803151200_201803151300_UFM Assignment MEasurement (Per Cell).csv |
| size | 592776 |
| mtime | 1521108187 |
| mtime_string | Thu Mar 15 15:03:07 PKT 2018 |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+