Topic "Skip zero byte files"

Author Message
DWVZ2000
[View user's profile]

Joined: 2015-07-27
Posts: 7
Location: USA
We have programs that create numerous files to be transferred to FTP sites. Sometimes some of these files end up with nothing in them, a file size of 0 bytes simply because there is no data for that particular day. When I run WinScp to transfer the files, it transfers all files including the empty files with 0 bytes. We transfer a number of files daily, and the users of the FTP sites I am transferring to don't want me to transfer 0 byte files. Is there a way to only transfer files that have a file size greater than 0 bytes? Basically skip files that have 0 byte size?

Thanks,

David
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Use file mask *>0

See https://winscp.net/eng/docs/file_mask
DWVZ2000
[View user's profile]

Joined: 2015-07-27
Posts: 7
Location: USA
prikryl wrote:


Using the size option I either get an error file not found using below :
""put \\Moss\departments\ePremis\MEDASSIST\" & "*%TimeStamp#mmddyyyy%" &
".TXT>1K"" & ""exit"" "

OR using code below it runs but doesn't find the files > 1K
""put \\Moss\departments\ePremis\MEDASSIST\" & "*%TimeStamp#mmddyyyy%" & ".TXT"
& ">1K"" & ""exit"" "

What am I doing wrong?

Thanks,

David
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
You are missing a space between the put and exit commands.
DWVZ2000
[View user's profile]

Joined: 2015-07-27
Posts: 7
Location: USA
Here's the command I am using AND
I have attached a screen shot of what I get.
I put the space between the "put" and the "exit".
Here is the name of the file I am trying to transfer that is > 1K.

Thanks,

David
winscp1.jpg (51.32 KB) Private file

Description: Screen shot where winscp doesn't find file > 1K. File name is MEDASSIST_PLC_12032015.TXT

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
My fault.

I didn't realize it's a mask for a local file, where the size criteria does not work directly.

You have to use -filemask switch:

put \\Moss\departments\ePremis\MEDASSIST\*%TimeStamp#mmddyyyy%.TXT -filemask=>1K
DWVZ2000
[View user's profile]

Joined: 2015-07-27
Posts: 7
Location: USA
prikryl wrote:
My fault.

I didn't realize it's a mask for a local file, where the size criteria does not work directly.

You have to use -filemask switch:

put \\Moss\departments\ePremis\MEDASSIST\*%TimeStamp#mmddyyyy%.TXT -filemask=>1K


THANK YOU VERY MUCH. I finally have it working.
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