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

What is event handling in vbscript?

593


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

1782


hi all, i had a question, that how to find out hiding a coloumn in a table i had a table having the following column names NAME DESCRIPTION CREATED TIME CREATED USER if i right clicked on a NAME column it will displays a menu having the same column names in a list like NAME DESCRIPTION CREATED TIME CREATED USER with check boxes.if i unched any check box, that column name should not be appear in the main table column names could anyone please solve this problem?

1546


Explain a few date functions in vbscript

553


What is the technology used by vb script?

539






How can you destroy an object in vbscript?

637


Is vbscript language a case-sensitive language and what does it mean?

542


What is vbscript language used for and which earlier language is it modeled upon?

527


Is vbscript a case-sensitive or case-insensitive?

750


What are the environments supported by vbscript language?

496


What are class variables?

610


Both Static and dynamic arrays are handled by VB script. Is it true?

605


How will you release the memory acquired by an array variable in vbscript?

740


Explain some uses of vb script?

547


Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)

3182