cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Using a File Poller to a File Reader

FalleurJ
New Contributor

Hello,

I am trying to figure out how to use a File Poller to make a file name a variable and then to use that variable as the file to use in a File Reader? I am not sure on how to get it to work. Also, how does the File Poller truly work if I have multiple files with the same name, but different timestamps, does it go through them 1 by 1? or all 3 at the same time for example? I using a file that is on an FTP server, and is dynamic with a time stamp, and there could be multiple files but with different timestamps.

9 REPLIES 9

skatpally
Former Employee

Yes It does keep polling one by one. Poller Snap polls the target directory and looks for file names matching the specified pattern. It keeps on polling at the Polling Interval property until the polling timeout is reached.The Snap returns all paths that matches the File Filter Pattern.

o/p

โ€œpathโ€: โ€œftp://XX.XX.XX.XX/HousingPhotos1_FullFeed.zipโ€
โ€œpathโ€: โ€œftp://XX.XX.XX.XX/HousingPhotos1_FullFeed.zipโ€
โ€œpathโ€: โ€œftp://XX.XX.XX.XX/HousingPhotos1_FullFeed.zipโ€

You can do a Split on the path and pass that to the File Reader Snap.

Split Function

$path.split(โ€˜/โ€™)[$path.split(โ€˜/โ€™).length-1].toString()

09%20PM

Hope this helps.

What would the file reader use to read the file from the Poller. Because my pipeline keeps having errors cause I donโ€™t know what the file name/variable needs to be to read it in the File Reader

You can directly pass the $path to the File Reader snap and read the data. Make Sure you have the Account selected in the Account Tab. Please post the error and sample pipeline for reference. Thank you.

FalleurJ
New Contributor

That is my pipeline. I am not sure if I am doing this correctly, I have the variable name set up in the Poller, and In the File read I have the account set up, but still donโ€™t understand the dynamics of the file name. Do I need to change the output in views to $path on the Poller Snap.

pl_street_level_fs_trade_2018_11_26 (1).slp (40.0 KB)