Download files starting with specific prefix from SFTP server using Execute Process Task and WinSCP in SSIS

Viewed 531

I am having couple of files present at WinSCP folder location USERDATA. Files present are staring with following names: ABC_XXXX.txt and XYZ_XXXX.txt.

I am interested in downloading all the files which are starting with ABC_ prefix only.

Below is my Execute Process Task configuration:

Executable- C:\Program Files (x86)\WinSCP\WinSCP.exe
/log=c:\path\to\log\winscp.log /command "open sftp://username:password@example.com/" "get /USERDATA/User_file.txt C:\User\Local\" "exit"

It's running fine when I am downloading a single file. How can we parametrize it to fetch the specific files which starts with prefix ABC_ only. Is there any way we can set the expression for this?

1 Answers

Use file mask ABC_*:

... "get /USERDATA/ABC_* C:\User\Local\" ...
Related