โ01-21-2019 10:07 AM
Hi there,
I have a need where I have to read multiple files from an sftp site and write all of those files (if they exist) to multiple file names. Would the binary reader fit the bill here?
Iโm familiar with the multi-file read and the directory browser. I can successfully use those snaps to read whatโs on the remote sftp server.
Right now Iโm using the File Readerโs Folder/File box in Settings to do something like this:
sftp://transmissions-uat.testsite.com/Outbound/Encrypted
It reads all of the files in the Encrypted folder. Attached to this snap is the File Writer snap which seems to write the latest file to my file name. Is there a way to write all of the files to multiple file names? Iโve seen some mention of the Binary Router snap. Would this be the way to go?
Thanks,
Vin
โ01-28-2019 01:42 PM
Hello again,
My integration is working: itโs going out to an sftp server and pulling in all unarchived files that start with this string:
WORKFILE.PSOURCE.HRCNFRM.*
This results in pulling in the same set of files multiple times.
The complete file string looks something like this:
BERKWORK.PSOURCE.HRCNFRM.2983249.20190108110621668
The file string has the date: 20190108
Iโd like to be able to pull in a file whose date string, above, matches the current date in the form YYYYMMDD. That way Iโd only be pulling in files whose โlookup stringโ matches the current date.
Could you provide a coding example?
Thanks again for all you help.
โ01-29-2019 09:39 AM
You can use the expression language to format a date to a string, which can be used to form the glob in the MultiFileReader. This expression should get you pretty close.
"BERKWORK.PSOURCE.HRCNFRM.*." + Date.now().toLocaleDateString({"format":"yyyyMMdd"}) + "*"
โ02-01-2019 04:38 PM
Thank you very much for that expression. Iโve made a lot of progress with the pipeline and the information youโve given me.
I would like to put that entire file name 'BERKWORK.PSOURCE.HRCNFRM.*." + Date.new().toLocalDateString({โformatโ:โyyyMMddโ}" into a variable or some other temporary holding area. In the pipeline, I would like to (probably?) use a Boolean expression to check for the existence of the file and send out an email (via the Send Email Snap) based on the condition being true (โ1โ).
Thanks again for all your help.