Write a VB Script to count blank Lines in a notepad

Answers were Sorted based on User's Feedback



Write a VB Script to count blank Lines in a notepad..

Answer / usha

set fso=createobject("scripting.filesystemobject")
set f=fso.opentextfile("C:usha.txt")

c=0

do until (f.atendofstream)

a=f.readline()

if len(a)=0 then



c=c+1

end if


loop

msgbox c

Is This Answer Correct ?    1 Yes 0 No

Write a VB Script to count blank Lines in a notepad..

Answer / pravati

Set fso=createobject("scripting.filesystemobject")
Set qfile=fso.OpenTextFile("c:Rinkuaby.txt",1,true)
Do While qfile.AtEndOfStream<>true

x=qfile.ReadLine
msgbox x
If len(x)=0 Then
y=y+1
End If
msgbox y
loop

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me

3 Answers   TCS,


What is wrong with the following code: <%afname="header.asp"%><!?#include file ="<%=afname%>"?>

1 Answers  


Could Anybody tell me the VBscript for REVERSE an Integer int reverse(int num) Ex:246 to 642

7 Answers   Amazon,


Mention what is the difference between vbscript and vba?

0 Answers  


if there is any string in a given format like as "company name employeecode date" then we have to fetch employeecode form string for ex-string is "capgemini12345june2013" then we have to fetch 12345 by using vb script so guys how can we do that please reply it.

3 Answers   Cap Gemini,






Which function allows you to instantiate an object given its programmatic identifier or progid?

0 Answers  


How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'

0 Answers  


who will create the object?

0 Answers   TCS,


Which date function is used in the vbscript language to find the difference between the 2 dates?

0 Answers  


How can you fetch the value of a cookie?

0 Answers  


Why do we use Option Explicit?

6 Answers  


What is the extension of the vbscript file?

0 Answers  


Categories