Find file that is empty that is 1KB

August 18, 2011 at 20:53:42
Specs: Windows 7
Hi folks, I have a situation in which some files that were send over from a application is empty but with file size. As such I could not use filesize to determine if the file is empty. I have tried to count the number of lines but not successful. I have tried the code below but fail.

Thank you in advance for the help.

Set destination=C:\Inbox\ZeroKB
Set filename= C:\Inbox\ORD_SG_201108*.ASC

for %%a in ('type %filename% ^|find "" /v /c') do (IF %%a equ 0 copy /Y %%a %destination%)

See More: Find file that is empty that is 1KB

Report •

August 19, 2011 at 09:06:48
If a file has a file size greater than zero then it is not empty. It may contain information that you cannot see with a text editor, perhaps just a lot of spaces but it is not empty. Or you have a serious problem with your file system that is misreporting file size.

What is the format of these files?


edited by moderator: Test edit -Razor2.3

Report •

August 21, 2011 at 08:42:59
the file is indeed zero. the format is in *.asc and I have gone thru the file and it does not contain space or anything. I have tried to use a token, it correctly report the number of lines but I could not get it to copy the file out.

Any advise would be appreciated. thank you.

Report •

Related Solutions

Ask Question