Write a program to print all lines that contains a word either “testing” or “qtp”

Answer Posted / syamala usha

set fso = createobject("scripting.filesystemobject")

set f=fso.opentextfile("C:
otes HP.txt",1)


Do until f.atendofstream

str=f.readline

a = split(str," ")

flag=0

for j = 0 to ubound(a)

if (a(j) = "testing") or (a(j) = "qtp") then

flag=1

exit for

end if

next

if flag=1 then

msgbox str

end if

loop

f.close

set f= nothing

set fso =nothing

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

create a form to accept username and password validate the username and password with using message box, display the corresponding user message

2159


Explain the .wsf files?

531


In what way program "hello world" you can write in vbscript?

645


What is the purpose of regexp object in vbscript?

553


How to get the length of the string by making use of the string function?

560






How can you create a file object to work with the files in the vbscript language?

505


What are the valid scopes of a variable in vbscript?

608


Illustrate briefly about the different types of statement

2023


Explain the functionality of vbscript?

538


What are the naming conventions while declaring a variable in the vbscript language?

618


how to automatically update the sql server2005 database records when insert in vb6?

1485


Explain the scope of the variables using dim, public, and private keywords respectively.

715


What is the scope of a constant declared using public?

557


Mention how to assign a date value to a variable?

585


What is the difference between do until loop and do while loop?

538