;~ AutoIt Version: 3.3.14.5
#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <File.au3>
_Example()
Func _Example()
Local $sDir = FileSelectFolder("", "")
If @error Then Exit
Local $aFiles = _FileListToArray($sDir, "*.txt", $FLTA_FILES, True)
If @error Then Exit MsgBox($MB_TOPMOST + $MB_ICONERROR, Default, "Файлы не найдены")
Local $aTemp, $aOut[0]
For $i = 1 To $aFiles[0]
$aTemp = FileReadToArray($aFiles[$i])
If Not @error Then _ArrayConcatenate($aOut, $aTemp)
Next
$aOut = _ArrayUnique($aOut)
Local $sFile = FileSaveDialog("", "", "Текст (*.txt)|Все (*.*)", $FD_PROMPTOVERWRITE)
If @error Then Exit
_FileWriteFromArray($sFile, $aOut, 1)
MsgBox($MB_TOPMOST + $MB_ICONINFORMATION, Default, "Готово!")
ShellExecute($sFile)
EndFunc ;==>_Example