Hi I have one text file which is with no data. I mean it is blank. I would like to use one if command if text file is blank. For example as below:
Can any body help me?Please Login or Register to view this content.
Hi I have one text file which is with no data. I mean it is blank. I would like to use one if command if text file is blank. For example as below:
Can any body help me?Please Login or Register to view this content.
Last edited by krish T; 11-14-2010 at 11:49 AM. Reason: solved
Did you consider checking the properties of a file ?
No.I don't have idea. Here I am looking for the following if it is possible:
step1: Check the text file.
step2: if it is blank, gives message that it is blank
step3: if it is not blank, it has to display the data
Please let me know if you need any other information.
Thanks
I have tried some thing as below: Please correct If it is wrong.
Here I am able to see the contents if text file is not blank and able to get the message as "The file is empty" if it is blank.Please Login or Register to view this content.
But not able to see all the contents if text file is big. How can I see all contents of text file?
Last edited by krish T; 11-13-2010 at 12:32 PM. Reason: modification
Hello krish,
This macro should help. If the file isn't 0 bytes then the text file will be displayed in NotePad. Once NotePad is closed, the macro will resume. If there is no data, the message dialog is displayed.
Please Login or Register to view this content.
Last edited by Leith Ross; 11-13-2010 at 02:26 PM. Reason: Removed unused variable
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Hi Leith Ross, That is what exactly I am looking for. Thanks a lot. Really helpful.
-krish
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks