11-17-2009, 02:08 AM
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
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
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