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

who will create the object?

1570


What is the output of a + b in vbscript if a = 5 and b = 10?

2549


I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?

964


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

1571


What is the difference between javascript and vbscript?

626






What are class events?

661


Hi Friends Rajendra this is bhavani prasad, iam working Hyderabad. i faced one problem with qtp recording mode i.e in my application there is 100 records first we click the first record that record will be jumped to next session and 99 records will there stop the recording and run the same script .Run this script qtp does not identify the records. So plz tell me what is the solution.

1658


who will create the object?

1807


why variable name should not exceed 255 characters?

1902


what do you mean .ota mobile format

2044


Mention what is select case statement?

624


Explain about the asc function?

694


What is the difference between function and procedure?

659


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

697


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

702