this is the code copy and execute it......................
Testing 1, 2, 3.
'This is a test.This is a test.
'key1=val1
'key2=value2
'key3=value3
'
'i want to get value2 in txt file "
set fso = createobject("scripting.filesystemobject")
set ofile = fso.opentextfile("C:\Documents and
Settings\Raghu\Desktop\test.txt",1,true)
While ofile.AtEndOfStream<>true
str = ofile.Readline
msgbox str
If str="key3=value3" Then
msgbox instr(str, "key3")
a= split(str,"=")
msgbox a(1)
End If
wend
ofile.close
set ofile = nothing
set fso = nothing
On Sat, Dec 31, 2011 at 1:56 PM, iRahulSingh <[email protected]>wrote:
> Hi raju,
>
> try this -
>
> set fso = createobject("scripting.filesystemobject")
> set ofile = fso.opentextfile("c:\test.txt")
> while not fso.endofstream
> str = ofile.readline
> if instr(str, "key2",1) then
> msgbox = split(str,"=")(1)
> end if
> wend
> ofile.close
> set ofile = nothing
> set fso = nothing
>
> On Dec 30, 12:38 pm, Raju Prasad <[email protected]> wrote:
> > Hi
> > testers
> >
> > plz help me how to write the code
> >
> > the txt file consists of the following
> >
> > *Testing 1, 2, 3.*
> > *This is a test.This is a test.*
> > *key1=val1*
> > *key2=value2*
> > *key3=value3*
> >
> > i want to get value2 in txt file
> >
> > yours
> > reddy prasad
>
> --
> 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
>
--
*Thanks&Regards*
* Pramod*
*9052456959*
--
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