So in etwa habe ich das gemeint:
AutoIt
#include <Array.au3>
$sFile = FileRead("datei.txt")
$aRegEx = StringRegExp($sFile, "(\d+\.\d+\.\d+ \d+:\d+ (?:.+?)+)", 3)
Local $aDates[0][4]
For $i = 0 To UBound($aRegEx) - 1
$aCurrentData = StringSplit($aRegEx[$i], " ", 3)
$aCurrentTime = StringSplit($aCurrentData[1], ":", 3)
$sLabel = _ArrayMerge($aCurrentData, " ", 2, -1)
$bFound = False
For $j = 0 To UBound($aDates) - 1
If $aDates[$j][0] = $aCurrentData[0] and $aDates[$j][1] = $aCurrentTime[0] and $aDates[$j][2] = $sLabel Then
$aDates[$j][3] += 1
$bFound = True
ExitLoop
EndIf
Next
If Not $bFound Then
ReDim $aDates[UBound($aDates) + 1][4]
$aDates[UBound($aDates) - 1][0] = $aCurrentData[0]
$aDates[UBound($aDates) - 1][1] = $aCurrentTime[0]
$aDates[UBound($aDates) - 1][2] = $sLabel
$aDates[UBound($aDates) - 1][3] = 1
EndIf
Next
_ArraySort($aDates)
$sFile = ""
For $i = 0 To UBound($aDates) - 1
$sFile &= $aDates[$i][0] & " " & $aDates[$i][1] & " --- " & $aDates[$i][3] & "x " & $aDates[$i][2] & @CRLF
Next
FileDelete("auswertung.csv")
FileWrite("auswertung.csv", $sFile)
Func _ArrayMerge($aArray, $sDelimeter = " ", $iStart = 0, $iEnd = -1)
If $iEnd = -1 Then $iEnd = UBound($aArray) - 1
Local $sMerge = ""
For $i = $iStart To $iEnd
$sMerge &= $aArray[$i] & ($i <> $iEnd ? $sDelimeter : "")
Next
Return $sMerge
EndFunc
Alles anzeigen
datei.txt
Code
02.01.2017 00:02 Wecker 29
02.01.2017 00:49 Wecker 29
02.01.2017 00:59 Wecker 50
02.01.2017 02:45 Wecker 29
02.01.2017 02:33 Stuhl
01.01.2017 00:02 Haus
01.01.2017 00:49 NULL
01.01.2017 00:59 NULL
01.01.2017 02:45 NULL
01.01.2017 02:33 NULL
Heraus kommt (die Intervalleanzeige (00:00 - 00:59 statt 00) kannst du ja selber anpassen):