Write a program to print all lines that contains a word either “testing” or “qtp”
Answers were Sorted based on User's Feedback
Answer / amit
''' Write a program to print all lines that contains a word either “testing” or “qtp”
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFile = fso.OpenTextFile("C:UsersAmit MoolchandaniDesktop est.txt",1,True)
Do While objFile.AtEndOfStream <> True
str = objFile.ReadLine
If Instr(1,str,"Testing",1) Or Instr(1,str,"qtp",1) Then
Print str
End If
Loop
objFile.Close
Set objFile = Nothing
Set fso = Nothing
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / 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 |
Which function is used to perform string comparison?
what is diff b/n these 2 programs 1) for i=5 to 1 step 2 msgbox "pass" next 2_) for i=5 to 1 step -2 msgbox "pass" next
Mention how to access array data?
How to assign a date value to a variable?
write a vb script create 5 folders test1 test2 test3 test4 test5
How to insert snapshot during manual scripting in QTP?
What is event handling in vbscript?
1)How to test whether items in a weblist are in alphabetical order or not?
Can automation testing find ssame no. of bugs what we can find by manual testing?
Which data type/types are supported by vbscript language and what are their specialties?
how does vb script help in web page designing? explain with example.
write script to open Gmail.com, and to write script for entering username and password and show whether the result as pass or fail