Forum Discussion
Hi Amar,
Sorry for the delay. I was thinking more about your scenario, and I think I have a better suggestion. Since you may not need to “poll” for the files, I am thinking a different Snap would be better.
Say I want to boil the problem down to grabbing the files, and then deleting them…You could use a MultiFileReader Snap, with a file filter to get the desired types of file. The output will be a binary data stream.
You could connect this to a BinaryToDocument Snap and then perform operations on that document. At some point you would need to use a Mapper to key on the filename and pass that to a FileDelete Snap.
For the simpler case of just say…reading files and deleting them for proof of concept, you could use a DirectoryBrowser instead of the MultiFileReader. The DirectoryBrowser would return you attributes about all of the files that match the type filter (essentially a List in document format versus binary). Then you’d plug this into a Mapper Snap, to map the filename. Then you’d plug this into a Delete Snap where you configure it to read the file name from the mapped variable.
I hope this helps you get further towards your goal!
Thanks,
-Charlie
Hi Charlie,
Thank you, for the giving other options. I am still struggling to process the files from the first snap.
I am providing my findings for your reference. Appreciate your inputs further.
MultiFileReader Snap is not taking sftp path under folder/file section. I am getting below exception:
The same path is working other Snaps but not in MultiFileReader Snap. Provide your suggestions based on the error.
Multi File Reader( Multi File Reader )
Reads binary data from an endpoint (e.g. file, sldb, s3, sftp, ftp, adl, etc).
Snap has the following errostrong textrs. Please open the info box and edit the highlighted fields.
Could not compile expression: _sftp://ftp.ext.hpe.com:2222/_SC … (Reason: Encountered extraneous input ‘:’ at line 1:4; expecting={, ‘||’, ‘&&’, ‘^’, ‘==’, ‘!=’, ‘>’, ‘<’, ‘>=’, ‘<=’, ‘+’, ‘-’, ‘*’, ‘/’, ‘%’, ‘?’, ‘instanceof’, ‘in’, ‘[’, ‘(’, ‘.’, PropertyRef}; Resolution: Please check expression syntax)
I’ve tried DirectoryBrowser and able to fetch files from the SFTP server and used mapper snap to take filename into the variable. If I use file delete snap again it is throwing same error as multi-file reader snap exception. The file parameter is not taking SFTP path with variable filename.
Appreciate your further support and also let me know how to extract data from the original file. The attributes from the directory browser snap showing bytes and name only.
Thanks in advance,
Amar
Hi dmiller,
Thanks for update, still we are facing below issues, please help me on this.
When we are using the as per the document format for attachement, we are not able to attached the file,2 Step: When we are used this file name <<TestingEmail.json>> Its getting the old file, not current file.
Thanks,
kullayappa- rohithmadhavan6 years agoEmployee
@Kullay There’s a race condition in this pipeline design if the File Writer Snap is writing to TestingEmail.json. Since the File Writer and Email Sender Snaps are disconnected, their relative order of execution isn’t guaranteed. I would suggest connecting the File Writer’s output view to the Email Sender’s input view as shown below.
@rohithmadhavan,
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438208/Email+Sender
as per the document, I have followed I am getting current file but it’s getting Empty files also.We are expecting only error time only.
Thanks,
kullayappa