Import only ".csv" files, getting other folders along with csv files

Advertisement

sanketK
Joined:
Posts:
6
Location:
India

Import only ".csv" files, getting other folders along with csv files

Hi,
I need to import only .csv files from a remote location. (created within last week)
In remote_dir, there are bunch of .csv files and other folder.
Problem: Getting folders along with csv files.

Script used:
"get ""/remote_dir"" -filemask=""*.csv>8D"" ""\\local_dir"" exit
Could you please assist on above query to exclude other folders which are importing with csv files.

Thanks,
Sanket

Reply with quote

Advertisement

sanketK
Joined:
Posts:
6
Location:
India

Re: Import only ".csv" files, getting other folders along with csv files

Hi Martin,
I have tried like this,
"get ""/remote_dir"" -filemask=""*.csv>8D|*/"" ""\\local_dir"" exit
and got the output till "session started" in cmd.

Could you please advice?

Thanks,
Sanket

CMD.PNG

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,632
Location:
Prague, Czechia

Re: Import only ".csv" files, getting other folders along with csv files

You are missing a quote:
"get ""/remote_dir"" -filemask=""*.csv>8D|*/"" ""\\local_dir""" exit
Though that might not be the cause of your immediate problem. There might be another problem earlier in your batch file. Show us your while batch file if you need more help.
See also Why are some WinSCP scripting commands specified in a batch file not executed/failing?

Reply with quote

Advertisement

You can post new topics in this forum