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 |
can anyone send me a vb scripts code for clicking on a link and coming back on home page again does the same for many links on a web page.
Explain the adodb.stream class?
What are the disadvantages of vbscript?
how to write validation function for date in vb script
write a vb script to generate the following pattern ***** **** *** ** *
If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?
write a vb script to rename a folder from tree4 to tree7
join all the array values without using join function?
print the array values in ascending order?
What is wrong with the following code: <%afname="header.asp"%><!?#include file ="<%=afname%>"?>
What methods are used to create text files and open text files in the vbscript language?
What is the main difference between function and sub-procedure?