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 check the particular window is exist or not with out using check points

2 Answers  


What are the special sub-types in vbscript?

0 Answers  


How to add actions in driver script to run those actions in QTP?

0 Answers  


hey please tell me how to retriev data from excel sheet which puts the login name and password in the application? plz send me the code..please help me

6 Answers   HP,


How you can call vbscript functions?

0 Answers  






In our application qtp unable to indentify the menu items,we tried number of times to add objetcs into object repository but fail. through normal recording mode only objects going to add into repository but while running same recording script qtp showing a error like " unable to indentify the object". in repository there is no any properties and pro values for that object and also i tried with virtual object config also unable to find the object in application and in repository. Then what i have to do to identify menu objects????? can anybody hell me pls..............

2 Answers   Blue Star,


Which function is used to perform string comparison?

0 Answers  


How can the spaces from the string be removed?

0 Answers  


i have to open a notepad having no. of words in dat file by recording in qtp and then find a particular word and display true or false

0 Answers  


Write a program to create a Dynamic array of size 5 elements and display all the elements.

1 Answers  


How are comments handled in the vbscript language?

0 Answers  


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

1 Answers  


Categories