Topic "How to use wildcards to copy specific files in nested dirs?"

Author Message
rinuxguy

Guest


Let's say I want to use the WinSCP GUI to copy only the files that end in .png or .jpg from a folder called image. So basically I want to drag over the image folder and only copy those files.

The image folders contains many folders nested deep inside it, so I want WinSCP to recursively search all those nested directories for my file types as well. I want it to copy over those .png and .jpg files and place them in the same folder structure they were found in.

How can I do this using the WinSCP GUI? Thanks!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Depends on version of WinSCP you are using.
With 4.x, you need to use: */; *.jpg; *.png
With 5.x beta, it is enough to use: *.jpg; *.png
See http://winscp.net/eng/docs/file_mask
Also with 5.x you can use file mask editor:
http://winscp.net/eng/docs/ui_editmask
rinuxguy

Guest


Thanks for the tip. I'm using 4.x. I tried "*/; *.jpg; *.png" and it is copying the entire subfolders over rather than just the jpg and png files located inside those nested folders. I believe since the directory mask */ is specified, it's just copying over the whole directory over.

How do I make it so it goings through those nested directories but only copies jpg and png files only in those directories?

prikryl wrote:
Depends on version of WinSCP you are using.
With 4.x, you need to use: */; *.jpg; *.png
With 5.x beta, it is enough to use: *.jpg; *.png
See http://winscp.net/eng/docs/file_mask
Also with 5.x you can use file mask editor:
http://winscp.net/eng/docs/ui_editmask
rinuxguy

Guest


One other note, I tried the 5.x beta and the mask you specified but it didn't apply the file mask to the subfolders, it was only applied to the current folder.
rinuxguy

Guest


I got it now, please ignore my previous replies. I tried the 5.x beta, right clicked on the folder I wanted to copy, chose Copy, click on Transfer settings, then clicked on the Edit button in File Mask. From there I entered the files I wanted. It works great!
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License