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
How to Enter Values on the Command promt using VB script
how to set one column as primary key in QTP and fetch values accordingly
How will you get the smallest subscript of an array in vbscript?
What is the difference between javascript and vbscript?
What is the difference between do until loop and do while loop?
Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.
How to pass argument by reference to a function in vbscript?
Mention what is the technology used by vb script?
What is the difference between a dictionary and an array?
How do i automate a website www.flyashx.com without having any test cases witin a week time.
Explain a few date functions in vbscript
Explain vbscript in detail?
How you can call vbscript functions?
what is the use of QCUtil? explain with one example?
Which operator can be used to change the value of the operand or change the state of the condition?