Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing a particular name from a file to another file
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
I need some help for reading from a text file, and writing a specific data starting with an element into another Text file

I tried with following code and the code is asfollows

Code:
Option Explicit
Dim oFSO, oTxtFile, sLine,oFilename,oFTO
Const ForWriting = 2
Const ForAppending = 8

'Dim oFSO, oTxtFile

Set oFTO = CreateObject("Scripting.FileSystemObject")
Set oTxtFile = oFTO.OpenTextFile("C:Newfolder\XXXXX.YYY_ZZZ.xml", 1)
oTxtFile.Skipline
Do Until oTxtFile.AtEndOfStream
oTxtFile.skip(70)
sLine = oTxtFile.ReadLine
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFilename = oFSO.OpenTextFile("C:\Bundle\Filename.txt",ForAppending)
oFilename.WriteBlankLines(2)
oFilename.Write (sLine)
oFilename.Close
Loop

Actually i need to open a .xml file and note all the specific name starting with Name"xyz.xml", which has a list of xml names from line 2 to end of the file,which is arounf 70 character in a line so i wondering how to capture only the name of the .xml file
Reply


Messages In This Thread
Writing a particular name from a file to another file - by zealdeep - 11-17-2009, 02:08 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: 4 Guest(s)