#include "array.au3"
$t = getpath(@ScriptDir & '\tmp.txt')
_ArrayDisplay($t)
Func getpath($file)
if not FileExists($file) Then
Return
SetError(1)
EndIf
Local $array[1]
$f = FileOpen($file, 0)
While 1
$chars = FileReadLine($f)
If @error = -1 Then ExitLoop
;TrayTip("", $chars, 2)
$path = StringRegExp(StringStripWS($chars,2), '[a-zA-Z]:(\\[^/:\*\?<>\\|]+)*', 2)
if IsArray($path) Then
_ArrayAdd($array, StringStripWS(StringRegExpReplace($chars, '[a-zA-Z]:(\\[^/:\*\?<>\\|]+)*', ''), 3) & ',' & $path[0])
EndIf
Wend
_ArrayDelete($array,0)
FileClose($f)
Return $array
EndFunc ;==>getpath |