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

while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

0 Answers   IBM,


How to use Text file (Notepad) as ur data source in QTP? Can u please provide some function code for it?

1 Answers  


Explain about tristate constants?

0 Answers  


after medical test,when will be the police verification

0 Answers   IBM,


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

0 Answers  


When are redim statement and preserve keyword used in the vbscript language?

0 Answers  


i have to open a notepad having no. of words in dat file by recording in qtp and then find a particular word and display true or false

0 Answers  


hey please tell me how to retriev data from excel sheet which puts the login name and password in the application? plz send me the code..please help me

6 Answers   HP,


Write a code to print numbers from 5 to 0?

0 Answers  


How to get path of the file through scripting?

1 Answers   Hexaware,


Which operator can be used to do an xor operation in vbscript?

0 Answers  


how to validate the text in a web table

2 Answers   Mphasis,


Categories