Follow

How to use text files from a FTP source

We have the script feature called FTP Source. That can be used to extract files from a FTP server. It can be added from the script section in the business unit area.

Set up a FTP Source

The first thing though is to get one of the text/csv files from the FTP server and download it to a specific folder. The folder needs to be located where it will always be available and the developer user and service user needs to have rights to this folder.

Set up a multiple text files data source

The setup could be like this.

FTP_0.PNG

Start by connecting directly to one file, then go to the columns pane and pull in all the fields and set up data types for them. Then change the file location manually so it writes *.GL33-Exp.csv; instead. The post processing choice should be considered. I would use Backup and store the files in another folder after it is done processing.

FTP_1.PNG

Do a deploy / execute of the data source.

Add the FTP Source

Then add a FTP Source. It is created as a script action, but is only available in the Business Unit.

FTP_3.PNG

To set up the FTP Source the server name and a valid user account is needed. What is really important is the area i marked red. You need to know the folder and it should always start with /, the folder you chose in the previous step and the file name as well.

FTP_4.PNG

Try it out by testing the connection. The message below is posted if it is successfully.

FTP_5.PNG

Then set it up as a Pre-Script on the Textfile table we created.

FTP_6.PNG

Other issues to take into account

Sometimes the text files in the FTP server are temporary. To avoid data loss you might need to set the table up to run as a history table. It should be set up with natural keys and then all the other fields as type 1.

FTP_7.PNG

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.