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?
1.I want to establish connection with excel and also want to fetch the data using SQL queries. 2.the code should be written in such a way that in future if I want to migrate from excel to MS excess database , then there should be minimal changes.
How many types of procedures are available in the vbscript language?
Mention the environments where vbscript could be run?
What is the purpose of drive object of scripting.filesystemobject class in vbscript?
How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
Anyone have qtp11.0 crack?
What is the use of the date function in the vbscript language?
Which object is used to work with the database in the vbscript language and what statement is used to create this object?
Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?
How can you destroy an object in vbscript?
Which function is used in the vbscript language to convert the specified expression into a date type value?
Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?
What is loose binding? Why is it not a good practice to use it?