Jump to content

Empty File, but may contain blank line(s)


Go to solution Solved by kylomas,

Recommended Posts

Posted

I have to process incoming files in a landing folder.

I use method similar to this to detect if the file is empty, I won't process it.

'?do=embed' frameborder='0' data-embedContent>>

the problem is, sometimes files can contain 1 or 2 blank lines..

and i consider this empty files as well.. 

so what's a good method of detecting that file contains (any) number of blank lines ..?

Thanx ..

  • Moderators
Posted

How about a simple FileRead?

$sFile = @DesktopDir & "\Test.txt"
$sString = FileRead($sFile)
 MsgBox(0, "", ($sString = "") ? "File is empty." : "File contains data of some sort.")

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...