#include <MsgBoxConstants.au3>
#include <StringConstants.au3>
#include <Array.au3>
#include <File.au3>
Local $file = Fileread(Fileopen("Pushliste.txt"))
Dim $sc
Local $ArrayName = 0, _
$iOffset = 1
Local $bla0[0]
Local $bla1[0]
FileDelete("Testerino.txt")
While 1
$ArrayName = StringRegExp($file, '(?i)</b> bekam eine Hilfslieferung von <b>(.*?)</b>!<br>(.*?) (.*?)', 1, $iOffset)
If @error Then ExitLoop
$iOffset = @extended
For $i = 0 To UBound($ArrayName) - 3
If $ArrayName[2] = "Seelen" Then ContinueLoop
FileWrite("Testerino.txt", $ArrayName[0] & ";" & $ArrayName[1] & @CRLF)
_ArrayAdd($bla0, $ArrayName[0])
_ArrayAdd($bla1, $ArrayName[1])
Next
WEnd
_FileReadToArray("Testerino.txt", $sc)
;~ _ArrayDisplay($sc)
_ArrayDisplay($bla0)
_ArrayDisplay($bla1)
Local $summe = 0
If @error Then
MsgBox($MB_SYSTEMMODAL, "Not Found", '"' & $bla0[0] & '" was not found in the array.')
Else
;~ _ArrayDisplay($iIndex, "Results of searching for 0 in $avArray")
Local $aArrayUnique = _ArrayUnique($bla0) ; Use default parameters to create a unique array.
_ArrayDisplay($aArrayUnique, "$aArray Unique") ; Display the unique array.
For $o = 1 To $aArrayUnique[0]
Local $summe = 0
Local $iIndex = _ArrayFindAll($bla0, $aArrayUnique[$o])
;~ _ArrayDisplay($iIndex)
For $j = UBound($iIndex)-1 To 0 Step -1
;~ ConsoleWrite($aArrayUnique[$o] & " " & $j & " ,line->" & $iIndex[$j] & " WERT: " & $bla1[$iIndex[$j]] & @CRLF )
$summe = $summe + $bla1[$iIndex[$j]]
If $j = 0 Then
ConsoleWrite($aArrayUnique[$o] & ": " & $summe & @CRLF)
EndIf
_ArrayDelete($bla0, $iIndex[$j])
_ArrayDelete($bla1, $iIndex[$j])
Next
Next
EndIf
;~ _ArrayDisplay($bla0)
;~ _ArrayDisplay($bla1)