$sData="2009/06/03 12:28:17 * FILENAME1.zip-1523KB * FILENAME2.zip-1435KB * FILENAME3.zip-1325KB * FILENAME4.zip-1229
KB * FILENAME5.zip-1379KB * FILENAME6.zip-829KB * FILENAME7.zip-1046KB * FILENAME8.zip-1137KB * FILENAME9.zip-1481KB * FILENAME10.zip-1554KB * FILENAME11.zip-1339KB"
$dTotal=0.0
For Each $sField in Split($sData)
If InStr($sField,".zip-")
$sFile=Split($sField,"-")[0]
$dSize=CDbl(Left(Split($sField,"-")[1],-2))
$sScale=Right(Split($sField,"-")[1],2)
"File '"+$sFile+"' has size "+$dSize+" "+$sScale@CRLF
; If the input contains a mix of KB, MB, GB then you will need to scale it
; I'm scaling to the smallest unit (byte) so that no information is lost
Select
Case $sScale="KB"
$dTotal=$dTotal+$dSize*1024
Case $sScale="MB"
$dTotal=$dTotal+$dSize*1024*1024
Case $sScale="GB"
$dTotal=$dTotal+$dSize*1024*1024*1024
Case $sScale="TB"
$dTotal=$dTotal+$dSize*1024*1024*1024*1024
EndSelect
EndIf
Next
; Display total, converted to MB
"Total size="+FormatNumber($dTotal/1024/1024,2)+" MB"+@CRLF