11-18-2009, 12:49 AM
the data in xml file from which i need to read data is in the below form
now i will have to just read the name in each line i.e. XYZ-1234.xml, and write in another file.
I tried from the below code
I am looking for considering from the name element, like the xml file name (XYZ-1234.xml) should only be considered as the no. of digits in homecsi may vary from 3 to 5 digits, so could you please suggest me something where i can just consider the filename, and not the count from each line
Thanks
Deepak
Code:
<manifest docCount="00005" datauri="data/ABC_XYZ.DOCS" db="ASDF" triggersuffix="POP.1289">
<details> homecsi="1212" name ="XYZ-1234.xml"/></details>
<details> homecsi="1212" name ="ABC-2345.xml"/></details>
<details> homecsi="1212" name ="ASD-3456.xml"/></details>
<details> homecsi="1212" name ="QWE-2346.xml"/></details>
</manifest>
now i will have to just read the name in each line i.e. XYZ-1234.xml, and write in another file.
I tried from the below code
Code:
Option Explicit
Dim oTxtFile, oFTO,sCharacters
'Creating an object
Set oFTO = CreateObject("Scripting.FileSystemObject")
Set oTxtFile = oFTO.OpenTextFile("D:\Documents and Settings\Desktop\sample.xml", 1)
'To skip the first line
oTxtFile.Skipline
'To read and write data from a textfile till endof stream
Do Until oTxtFile.AtEndOfStream
' Skip the characters till charater 32
oTxtFile.skip(32) ' this count of characters skipped may vary from each manifest file
If oTxtFile.AtEndOfStream Then
Exit Do
End If
sCharacters = oTxtFile.Read(12)'for reading only the .xml file name
MsgBox sCharacters
oTxtFile.SkipLine
Loop 'end of Do loop
I am looking for considering from the name element, like the xml file name (XYZ-1234.xml) should only be considered as the no. of digits in homecsi may vary from 3 to 5 digits, so could you please suggest me something where i can just consider the filename, and not the count from each line
Thanks
Deepak