11-26-2018 10:58 AM
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.
11-26-2018 12:33 PM
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()
Hope this helps.
11-26-2018 01:02 PM
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
11-26-2018 01:49 PM
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.
11-26-2018 02:22 PM
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.