Hi All,
I need a code, which returns a particuler whole line from the text file.
Does anybody knows any direct function for that, I know below two ways to do
so but looking for some better method.
set fso=CreateObject("scripting.FileSystemObject")
set ofile=fso.OpenTextFile("c:\sain.txt,false,true)
Ncount=0
while ofile.AtEndofSteam<> true
Ncount=Ncount+1
if Ncount=3 then
msgbox ofile.ReadLine
exit loop
end if
Wend
,
'second method
set fso=CreateObject("scripting.FileSystemObject")
set ofile=fso.OpenTextFile("c:\sain.txt,false,true)
str1=ofile.ReadAll
str2=split(str1,char(10),-1,1)
'so for third line
msgbox str2(2)
'
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en