Quantcast
Channel: SCN : Unanswered Discussions - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 3719

How to get latest file using wait_for_file() function

$
0
0

Hi All,

 

I am facing issue using wait_for_file function, my requirement is in my source file path C:\FTP\PROD_20150314.csv  & PROD_20150314.csv two files having same name with different time factor. When I start  job want to take only one file that is latest one need to be process. How to set this option in wait_for_file function. currently I am using this pattern.

 

Substitution Param:

==================

$$Filepath = 'C:\FTP'

$$Filename = 'PRODUCT_*.csv'  (i.e. PRODUCT_20150314.csv)

 

 

Script:

=======

$PATH  ='[$$Filepath]';

$Filename = '[$$Filename]';

wait_for_file('[$PATH]'\\'[$Filename]', 0, 0, 1, $filestat);

$filestat = replace_substr($filestat,'/','\\');

 

 

What changes is required to get latest file from the path.

Thanks in Advance...!!!!

 

 

Regards,

Srini


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>