Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a program to print all lines that contains a word either “testing” or “qtp”

Answers were Sorted based on User's Feedback



Write a program to print all lines that contains a word either “testing” or “qtp&r..

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

Write a program to print all lines that contains a word either “testing” or “qtp&r..

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

Post New Answer

More VB Script Interview Questions

Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?

0 Answers  


What are the 2 ways in which a variable can be declared in the vbscript language?

0 Answers  


What is vbscript procedures?

0 Answers  


Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?

0 Answers   Tech Mahindra,


sunday is sunday monday tuesday wendesday sunday thursday friday saturday sunday sunday how to count no of sunday in the text file from vb? Answer me asap

4 Answers  


how to find the textfile in the folder and copy file from one folder to another folder useing parameterigation in QTP

1 Answers   Accenture,


Which object is used to work with the database in the vbscript language and what statement is used to create this object?

0 Answers  


Explain what is loose binding? Why is it not a good practice to use it?

0 Answers  


Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?

0 Answers  


Which loop is used in case of arrays in the vbscript language?

0 Answers  


what does create object actually do when you call it in vbscript?

1 Answers   Cap Gemini,


wht must be the interview question on corinthian information technology solutions incorporated.

0 Answers   HP,


Categories