Hi Guys
Many thanks for your comments, here are my replies to the points raised. I have written many interface programs over the last 4 years using AutoIT and this is the first time that I have encountered a problem I could not resolve. It is also the first time that I have attempted to process a large number of files at once.
I have written a version using _FileListToArray() but I had the same problem.
The data files are imported to my local drive via ftp. I am an admin, therfore have full control of all data.
The confussion over the file entry failure was in my haste to post I just copied the last entries.
Extract of the Console output:
#1566 $os = 28-01-2011,1544,42006696,0500,EX3_SCHSTS_001727449.xml
Fileo Handle = 2
processing file EX3_SCHSTS_001727450.xml
#1567 $os = 28-01-2011,1544,42006700,0500,EX3_SCHSTS_001727450.xml
Fileo Handle = 2
processing file EX3_SCHSTS_001727451.xml
#1568 $os = 0,0,,0,EX3_SCHSTS_001727451.xml
Below are the files prior to and the point of failure.
Prior File content:
<?xml version="1.0" encoding="utf-8" ?>
- <rmc>
<date>28-01-2011</date>
<time>1544</time>
<summit_co>01</summit_co>
<summit_module>jtent</summit_module>
<mode>A</mode>
- <ticket>
<field id="ticket_no">42006714</field>
- <field type="mtext" id="jtca_notes">
<text />
</field>
- <field id="status">
<value>0500</value>
</field>
</ticket>
</rmc>
Error File content:
<?xml version="1.0" encoding="utf-8" ?>
- <rmc>
<date>28-01-2011</date>
<time>1544</time>
<summit_co>01</summit_co>
<summit_module>jtent</summit_module>
<mode>A</mode>
- <ticket>
<field id="ticket_no">42006723</field>
- <field type="mtext" id="jtca_notes">
<text />
</field>
- <field id="status">
<value>0500</value>
</field>
</ticket>
</rmc>
Maybe the fileopen error is a symptom if my previous calls to extract the values or the tags from the xml.
here is the function, it may help
;*********************************************************************************************
;$s = String
;$t = Tag
; returns array of values between start and end tags
;*********************************************************************************************
Func _XMLData($s,$t)
dim $a[1]
$nOffset = 1
While 1
$array = StringRegExp($s, '<(?i)' & $t & '>(.*?)</(?i)' & $t & '>', 1, $nOffset)
If @error = 0 Then
$nOffset = @extended
Else
ExitLoop
EndIf
_ArrayAdd($a,$array[0])
return($array[0])
WEnd
_ArrayDelete($a,0)
;_ArrayDisplay($a)
EndFunc
Cheers
AlanB