How to use WinSCP commands to get multiple files with different ending name

Viewed 531

Trying to connect to SFTP connection where there are few CSV files placed in folders and want to download multiple files at once

The directory is exports/payroll_exports.

There are 3 files there for now:

vani_payroll_bayshore_21323_232.csv 
vani_payroll_bayshore_21344_256.csv 
vani_payroll_bayshore_124523_888.csv

How to use a get command where I can write get vani_payroll_bayshore%.csv?

I plan to add the get command to a script like this:

option batch on
option confirm off
open sftp:.... -hostkey= "...."
cd exports/payroll_exports
lcd  "\\....."
get ( don't know how to write the wildcard syntax)
close 
exit
1 Answers

WinSCP uses the common file wildcard syntax as most other applications.

To match anything of any length, use *.

get vani_payroll_bayshore*.csv

See WinSCP masks documentation.

Related