Forum Discussion
17 Replies
- Aleksandar_AContributor III
Hi @sathishmadavali,
One way to filter only today’s files is to browse the S3 Bucket using the S3 Browser and after that to use a Filter Snap with the following expression:
Date.parse($lastModified) >= Date.parse(Date.now().toLocaleDateString())
If your file pool in S3 is growing at increasing rate you might consider another approach.
Let me know if this helps you.
BR,
Aleksandar.- sathishmadavaliNew Contributor II
Hi,
@AleksandarAngelevski , the output of the filter snap is in csv format, by using which snap we can read the csv data .after getting the today file.thanking you
m sathish- Aleksandar_AContributor III
Hi @sathishmadavali,
If you are using the S3 Browser Snap then the output is as in the picture below:
You will have to use the File Reader Snap with the appropriate S3 Account and you will need to pass the Path value from the Filter Upstream.
File Reader Snap:
Let me know if this helps.
BR,
Aleksandar.
- sathishmadavaliNew Contributor II
@AleksandarAngelevski ,THANK YOU
- darshthakkarValued Contributor
For your reference,
Date.now().minusDays(1).toLocaleDateString()
Try to incorporate this in your pipeline and test it out.Regards,
Darsh- sathishmadavaliNew Contributor II
@darshthakkar , it will through an error
- darshthakkarValued Contributor
@sathishmadavali : You can use 2 snaps over here:
-
Multi-File Reader and provide the path ensuring that the wildcard only takes into consideration the format you’re looking for (e.g. csv). You will have to specify multiple paths if you’re wanting to read multiple files.
-
Using router → if you go into views, you can add additional views for which you can write different functions like $objectKey == “testing.csv”, second function would be $objectKey == “testing.json” so on and so forth. This works if you’re having $objectKey in your upstream.
Moreover, I would also urge to open a new topic as we have branched out from reading today’s file to separating files. Thankyou.
-
- darshthakkarValued Contributor
@sathishmadavali - I have created a new topic: Routing files from S3
- darshthakkarValued Contributor
@sathishmadavali - Please mark the solution provided by @AleksandarAngelevski as “solution” so that this thread can be closed.
- darshthakkarValued Contributor
You had to tweak a little bit, are you having $lastModified in your upsteam?
- sathishmadavaliNew Contributor II
@darshthakkar ,tq now its working
- sathishmadavaliNew Contributor II
@AleksandarAngelevski ,
@darshthakkar
After browse the files from s3 browser how to send csv files into one end point and excel files into another end point and json files into another end point.Thank you,
M Sathish