In my QTP script I have a word in notepad that ends in a
question mark, for example... "father?" As part of my
script I want to delete the question mark. How do you
delete a character in notepad?

Answers were Sorted based on User's Feedback



In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / satya

U can do it with SFO script[I am not sure of Syntax or
exact code,just approach I m Mentioning Below]-
Set oObj=createObject("Script.FyleSystemObject")
oFile=oObj.openTextFile("YourPath")
Do Until EndOfSream
oStr=oObj.readLine
if InStr(oStr,"?")>0 Then
RePlace(oSter,"?","")
Loop

Is This Answer Correct ?    3 Yes 2 No

In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / lak

Const ForReading = 1
'Save notepad file in D: Drive and type Father? then save

Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("D:\Find.txt", ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "?", "")

Set objFile = objFSO.OpenTextFile("D:\Find.txt", ForWriting)
objFile.WriteLine strNewText

objFile.Close

Is This Answer Correct ?    1 Yes 0 No

In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / saff

i am asuming there is only one "father?"
string in file
open the desired notepad
and them search for the desired string byusing instr
v = instr(filename,searchstring)'the position of the string
father
b=instr(filename,"?") 'the position of the ?
n =b-n ' will give the size of the string

now use the replace function to replace the ? with whatever
uw want

it will show the position of first occurance of the stirng

Is This Answer Correct ?    0 Yes 0 No

In my QTP script I have a word in notepad that ends in a question mark, for example... "fathe..

Answer / ratikanta

Word="father?"
Set Fso=Createobject("scripting.filesystemobject")
Set Fs=Fso.opentextfie("path")
X=Fs.Readline
mydata=split(X," ")
If mydata=word Then
str=Replace(mydata,"?","")
EndIf
msgbox str

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

Problem with XML checkpoint in QTP ?

0 Answers  


How can I deploye a 'QTP Runtime environment only'

1 Answers   Indexis,


what is the recovery scenario?

1 Answers  


hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me

0 Answers   TCS,


Hi,All How to change background color of a cell in excel using qtp and that too with out using Excel Object.(I am importing the excel sheet by using ImportSheet method)

1 Answers  


how to merge object repositories?

4 Answers  


How to pass parameters into an action.Please explain me with examples

5 Answers  


if interviewer asked about the framework used for automation how we will handle the question..means what should be the answer..plz help..which framework u r used in our company?

1 Answers   iGate,


VB - Script Training in MUMBAI.

1 Answers  


i have doubt suppose iam purly working in manual, when i will get work to do on sql and performence testing? pls any one clarify doubt?

0 Answers  


what kind of frame work you used in your last project?

0 Answers   Deloitte,


Hi Friends, Would be great if you can provide the Model Question paper, Web site link or any reference s. Thanks & Regards, Byzoor,

0 Answers  


Categories