Gobinath 0 Posted July 2, 2011 <BackupSet> <Name>07-02-2011_12-43-34</Name> <OSVersion>Windows7</OSVersion> <CreationTime>07/02/2011 12:44:06</CreationTime> <DiskSize>40.0 GB</DiskSize> <DiskUsedSize>40.0 GB</DiskUsedSize> <BackupType>PARTITION_BACKUP</BackupType> <CompressionType>NO_COMPRESSION</CompressionType> <EncryptionType>NO_ENCRYPTION</EncryptionType> <Comment></Comment> <MaxNoOfIncrementals>600</MaxNoOfIncrementals> <VolumeSet>G,I</VolumeSet> <NoOfPartitions>2</NoOfPartitions> <Partition> <Name>G:\</Name> <Index></Index> <Size>20.0 GB</Size> <UsedSpace>1.53 GB</UsedSpace> </Partition> <Partition> <Name>I:\</Name> <Index></Index> <Size>19.99 GB</Size> <UsedSpace>202.13 MB</UsedSpace> </Partition> </BackupSet>here i m using this xml file how to read the name (which is bold) Exactlyand store in to variable ????????????backupsetinfo1.xml Share this post Link to post Share on other sites
taietel 34 Posted July 2, 2011 #include <Array.au3> $hXML = FileOpen(@ScriptDir & "\backupsetinfo1.xml") If $hXML = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $sXML = FileRead($hXML) FileClose($hXML) $aRet = StringRegExp($sXML, '<Name>(.*?)</Name>', 3) _ArrayDisplay($aRet) Things you should know first...In the beginning there was only ONE! And zero...Progs:Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Share this post Link to post Share on other sites
Malkey 231 Posted July 2, 2011 This example is a little bit more tailored to the .xml file in post #1. The reg. exp. pattern excludes matches having ":" present in between "<Name>" and "</Name>". #include <Array.au3> Local $sXML = FileRead(@ScriptDir & "\backupsetinfo1.xml") Local $aRet = StringRegExp($sXML, '<Name>([^:]*?)</Name>', 3) _ArrayDisplay($aRet) Share this post Link to post Share on other sites
Fubarable 1 Posted July 2, 2011 Myself, I'd do this with Java and its XPath library which are excellent tools for this type of job. Share this post Link to post Share on other sites
taietel 34 Posted July 2, 2011 If there are many attributes in the xml, I use eltorro's XML Dom Wrapper but for this it's easier to use SRE. Things you should know first...In the beginning there was only ONE! And zero...Progs:Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Share this post Link to post Share on other sites
Gobinath 0 Posted July 5, 2011 Thanks Guyz.............!!!!!!!!!!!! Share this post Link to post Share on other sites