cancel
Showing results for 
Search instead for 
Did you mean: 

How to list file names from an FTP in another file?

izzy_babcock
New Contributor II

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.

image

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!

1 ACCEPTED SOLUTION

@izzy.babcock

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

View solution in original post

8 REPLIES 8

SpiroTaleski
Valued Contributor

@izzy.babcock

Using Directory Browser you can list all the files from the given file location.

Regards,
Spiro Taleski

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?

@izzy.babcock

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

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