hai there..this is chandu..i have a txt file which
containing 1000 lines but at a time i want to retrieve 50
lines..after 50 lines i required to retrieve 51-100..like
that i want...so could anybody help me in this...thanks in
Advance..
Answer Posted / nanda.d reddy
Hi, check the Below function,
Public Function Func_ReadFromNoetpad
(str_filePath,int_frmLine,int_toLine)
Set fso = CreateObject("Scripting.FileSystemObject")
Set Notepad = fso.OpenTextFile(str_filePath,1)
int_Value = 0
Do While Notepad.AtEndOfStream <> True
getLine = Notepad.ReadLine
int_value = int_value+1
If int_Value => int_frmLine and int_Value <=
int_toLine Then
msgbox getLine
End If
Loop
Set Notepad = Nothing
End Function
Here "str_filePath" is location of the text file in
ur local machine, "int_frmLine" is for from which line u
want to get the data and "int_toLine" is for to which line
u want to get the data.
for example If u want to get the data from 20 to 30
Func_ReadFromNoetpad "C:\Documents and
Settings\sdevarapalli\Desktop\sample.txt",20,30
Note: Here i used msgbox to display the data, becoz i don't
the exact scenario what u want. If u send me what u want to
do with that i can update this function.
If any queries or concerns please mail at :
nanda.dreddy@gmail.com
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?
What are the different ways to invoke an application using QTP?
can u please explain what is the exact difference between qtp8.2 and 9.0
How to interact tool & application build in QTP?
In Remote acess server how u run a test?
Name the properties you would use for identifying a browser and page when using descriptive programming?
What is the use of defining a newobject in the object repository "Define New TestOject". How to use this further. If we define new testobject, how can it recognizes the objects properties of any application.
How you debug your script?
explain keyword driven framework with banking domain?
Explain the types of object repositorys in qtp?
what is clean sweep?
what is the difference between rational rose and QTP? WHICH TOOL IS BETTER TO LEARN? PLEASE SEND ME AT sana_50218@yahoo.com sandeep@epuratech.com
Difference between test object and run time object?
what are the critical test cases in crm? tell me atleast 5 critical test cases? what are the critical bug u find out while testing crm domain?
What is the architecture of your project? Can any one answer for this question plz........