Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing a particular name from a file to another file
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
following script should solve your problem

Code:
Option Explicit
Dim oTxtFile, oFTO,sCharacters,cTextFile,i,nametofind,name

'Creating an object
Set oFTO = CreateObject("Scripting.FileSystemObject")
Set oTxtFile = oFTO.OpenTextFile("C:\test.xml", 1)

nametofind = Split ( oTxtFile.ReadAll , "name =", -1)

For i=1 To UBound(nametofind)
             name = name & vbNewLine & Mid ( nametofind(i),2,12)
Next

'disaplaying the captured names
MsgBox name

'create a txt file
Set cTextFile=oFTO.createtextfile( "C:\test.txt",true)

'writing the names captured to the text file
cTextFile.writeline name
Reply


Messages In This Thread
RE: Writing a particular name from a file to another file - by pavansri - 11-19-2009, 04:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to update CSV File and need to Save same CSV File kotaramamohana 1 3,515 10-24-2015, 08:40 AM
Last Post: tigerliew
  Comapre txt file with different number of lines anushreebehura 0 1,741 06-02-2015, 06:28 PM
Last Post: anushreebehura
  How to read a text file using FSO from bottom to up order?? vallalarasu.p 0 2,505 10-13-2014, 11:14 AM
Last Post: vallalarasu.p
  How to find a file after downloading UFT_Newbie 1 2,970 09-18-2014, 08:43 PM
Last Post: UFT_Newbie
  how to create text file swayam 1 2,849 05-29-2014, 01:25 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 3 Guest(s)