10-06-2021 08:20 AM
Hello snapLogic Community!
I am very new to the solution, but loving it more each day 🙂
I am trying to read the name of files from an FTP directory and write the details to a separate file within the pipeline project folder.
I checked this post’s response, but this is listing assets in the SnapLogic environment, and I am looking to list the name of all files in an FTP location and print out the name of the files to a csv file or json.
Does anyone have any suggestions on how I can accomplish this?
Thank you in advance!
Solved! Go to Solution.
10-07-2021 07:14 AM
Once you run the pipeline, the file is stored in the same project space where the pipeline is located. You can download the file, and the data will be in human-readable format.
The Directory Browser Snap on the output in the $Name it references the Name of the file on that location.
Regards,
ST
10-06-2021 10:32 AM
Using Directory Browser you can list all the files from the given file location.
Regards,
Spiro Taleski
10-06-2021 10:59 AM
Thank you for your reply @Spiro_Taleski.
I had read over the documentation, but I am not sure how to actually get it to list the file names into another file. Which snaps should I use in this case?
10-06-2021 01:59 PM
Once you get all the files from the ftp location using the Directory Browser Snap, you can use a Mapper Snap in order to map necessary fields produced by the Directory Browser Snap.
My question is: Do you want only to print/store the file names from ftp in one file in SnapLogic? Or do you want for each file on ftp to create separate file in SnapLogic project folder?
Based on the type of the file(csv, json, xml, excel), that you want to store the details, there are designated Snaps for each like: JSON Formatter, CSV Formatter etc.
Regards,
Spiro Taleski
10-07-2021 05:24 AM
Hi @Spiro_Taleski,
For now, it would suffice to have an excel file where each row will contain the name of the file.
How do I reference the file name in the mapper? Is there a document listing all $fields that can be referenced on a particular snap?
Best,
Izzy Babcock