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

My questions is while writting descriptve programming, lets take flight reservation. Line1: systemutil.Run "D:\Program Files\Mercury Interactive\QuickTestProfessional\samples\flight\app\flight4 a.exe" dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "mercury" dialog("text:=Login").WinEdit("attached text:=Password:").Set "mercury" dialog("text:=Login").WinButton("text:=OK").click window("text:=Flight Reservation").Activate window("text:=Flight Reservation").ActiveX ("acx_name:=MaskEdBox").Type "111111" window("text:=Flight Reservation").WinComboBox("attached text:=Fly From:").Select "Frankfurt" window("text:=Flight Reservation").WinComboBox("attached text:=Fly To:").Select "London" window("text:=Flight Reservation").WinButton ("text:=FLIGHT").Click window("text:=Flight Reservation").dialog("text:=Flights Table").WinList("text:=From").Select "13536 FRA 08.00AM LON 08.45AM SR $163.00" window("text:=Flight Reservation").dialog("text:=Flights Table").WinButton("text:=OK").Click window("text:=Flight Reservation").WinEdit("attached text:=Name:").Exist window("text:=Flight Reservation").WinEdit("attached text:=Name:").Set "sagar", Now i m getting the error in the last line. it is not accepting the WinEdit("attached text:=Name:") Please do solve this urgent...! and i want to know how to insert additional properties for an object and which properties we need to select from the object spy.

3 Answers  


What are the different types of loops available in the vbscript language?

0 Answers  


How to map test cases with Automation script? Please explain in details.With example Thanks for your co-operation(In Advance)

1 Answers   Google, IBM,


My Salary is 65000. How Much TDS I have to pay

0 Answers  


Hi I am having one folder with set of text files now i want to read and write that text files data into QTP. Any help plsss.

1 Answers  






WHAT IS ENVIRONMENT VARIABLES?and where it is used in real time scenario?

2 Answers  


Write a VB Script to count blank Lines in a notepad

2 Answers   IBM,


What are the differences between sub procedures and function procedures?

0 Answers  


Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?

0 Answers  


How to create a cookie using vbscript?

0 Answers  


How to learn VB Script, Since iam working with QTP. So i need to learn VB script.

4 Answers   TCS,


can any body give the code to write the function for given suppose user login with usrer id and pwd to yahoomail.after cliking "sign in"if it is valid user id the next page will display userid'message box.( Note u have to use excel sheet to retrive the userid's data)

3 Answers   Bally Technologies,


Categories