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
who will create the object?
What is the output of a + b in vbscript if a = 5 and b = 10?
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?
how to automatically update the sql server2005 database records when insert in vb6?
What is the difference between javascript and vbscript?
What are class events?
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.
who will create the object?
why variable name should not exceed 255 characters?
what do you mean .ota mobile format
Mention what is select case statement?
Explain about the asc function?
What is the difference between function and procedure?
Which date function is used in the vbscript language to find the difference between the 2 dates?
What are the naming conventions while declaring a variable in the vbscript language?