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 |
how to display all the links in one page using vb script in qtp.
1 Answers DST Global Solutions,
How can you test font size, type and color using QTP tool?
What is the difference between VBScript and JavaScript?
how to write vb script code for login gmail page by using notepad and how to run script in notepad
a function that takes an integer array as an argument and returns the largest value in the array. Use the function in a program
What is the extension of the vbscript file?
Explain sga memory structures?
What are the data types supported by vbscript?
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
Is vbscript language a case-sensitive language and what does it mean?
What is vbscript procedures?
Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?