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

what is the Command used to start the QTp from Run.(start-> Run)

7 Answers   GE,


how we connect oracle or sql data server database to qtp. Hi Ram I was your answer for this. Can you kindly let me know in details steps on How we can connect to database. i am using QTP9.2 and SQL Server Database. I am new for QTP and this would be of great help.Thanks

2 Answers  


Is the provision for integrating QTP with QC ,available from the version 9.0 onwards only or even 8.2 version has such provisions?

1 Answers  


Want to verify notepad reports using QTP framework or any other BV script method. Can anyone share the method to achieve it? Eg. Person Name is the header and the actual name is John then how can we verify weather person name is John

0 Answers   IBM,


what is profile tool?

0 Answers   ITC Infotech, TCS,






I want different types of discriptive programming statments coded for different types of web-objects?Give syntax and example?

2 Answers  


How to find given string is palindrome or not without using strreverse() function?

2 Answers  


I am sathish , i want to test the Application of JIL.org ,Mobile Emulator ,by using QTP10.0. I am trying to do testing on that Application , but Child Objects are not identified by the QTP. Please can any one help me

0 Answers  


how to count spaces in a given string ex: "this is jagadeesh" in QTP with simple functional script

5 Answers   Cap Gemini,


In an output value text checkpoint, where does the output value stored by default ?

4 Answers   Ordain Solutions,


what is output value in QTP and how it can be used in automation testing

0 Answers  


How to find RAM size by using QTP?

2 Answers   IBM,


Categories