#include <File.au3>
#include <Array.au3>
#include <Excel.au3>
#include <Array.au3>
#include <Date.au3>
Global Const $sStdFilesDir = @ScriptDir & '\Standard' ; Здесь лежат "эталонные" файлы
Global Const $sFilesDir = @ScriptDir & '\Files' ; Здесь находятся каталоги с файлами "CassaNN"
Global $oExcel, $sInit
Global $aStdFile = _FileListToArray($sStdFilesDir, '*.txt', 1)
Global $aCatalog = _FileListToArray($sFilesDir, '*', 2)
Global $aData[UBound($aStdFile)][2]
Global $aCatalogValid[1]
Global $aFiles
Global $sDirMask = '(Cassa\d*)'
;Global $sFileMask = '(file\d*\.txt)'
;%%%%%%%%%%%%%% ФОРМИРУЕМ ВЫХОДНОЙ МАССИВ С ДАННЫМИ %%%%%%%%%%%%%%
For $i = 1 to UBound($aCatalog) - 1
If StringRegExp($aCatalog[$i], $sDirMask, 0) = 1 Then
_ArrayAdd($aCatalogValid, $aCatalog[$i])
EndIf
Next
$aCatalogValid[0] = UBound($aCatalogValid) - 1
For $i = 1 To $aCatalogValid[0]
ReDim $aData[UBound($aStdFile)][2 + $i]
$aData[0][$i + 1] = $aCatalog[$i]
Next
$aData[0][0] = 'Standart'
$aData[0][1] = 'STD Size'
For $i = 1 To UBound($aStdFile) - 1
$aData[$i][0] = $aStdFile[$i]
$aData[$i][1] = FileGetSize($sStdFilesDir & '\' & $aStdFile[$i])
Next
For $i = 1 To $aCatalogValid[0]
$aFiles = _FileListToArray($sFilesDir & '\' & $aCatalogValid[$i])
For $j = 1 To UBound($aData) - 1
$aData[$j][$i + 1] = FileGetSize($sFilesDir & '\' & $aData[0][$i + 1] & '\' & $aData[$j][0])
Next
Next
;_ArrayDisplay($aData, 'Output Array')
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%% ЗАПИСЬ EXCEL ФАЙЛА %%%%%%%%%%%%%%%%%%%%%%%
$sInit = _Now()
$oExcel = _ExcelBookNew()
_ExcelWriteCell($oExcel, 'Generated by AutoIt Script v.3+' & ' (' & $sInit & ')', 1, 1)
_ExcelFontSetProperties($oExcel, 3, 1, 3, $aCatalogValid[0] + 2, True, False, False)
_ExcelWriteSheetFromArray($oExcel, $aData, 3, 1, 0, 0)
_ExcelBookSaveAs($oExcel, @ScriptDir & '\Cassa_' & StringReplace($sInit, ':', '.') & '.xls', 'xls', 0, 1)
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; ВСЕ ! :))