Write a program to print all lines that contains a word either “testing” or “qtp”
Answer Posted / 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 |
Post New Answer View All Answers
How can you destroy an object in vbscript?
What is loose binding? Why is it not a good practice to use it?
How to Convert Hex color code to color name in VB Script?
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me
Explain about the functionality of vb script?
How are values assigned to string type and numeric type variables?
Mention what is vbscript procedures?
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder
Can any one provide code for Mid(string,start[,length]). I have been asked to write code for Mid(). i.e We need to define our own function say MyMid() which should behave same like built-in Mid function
How regexp.execute method works?
I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..
How to get the length of the string by making use of the string function?
Which date function is used in the vbscript language to find the difference between the 2 dates?
Which keyword is used to declare a variable in the vbscript language?
What is the difference between vbscript and vba?