bogQ Posted July 16, 2007 Share Posted July 16, 2007 #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray( @ScriptDir , "*.txt", 1 ) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") that will geave me the list of all txt files in the script folder So how to add the time of creation 4 all txt files in next Array row with FileGetTime("", 1) command? I understand how to write in second row with _ArrayDisplay but still i dont know how to combine FileGetTime with _FileListToArray so that i can have time 4 every file? TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
randallc Posted July 16, 2007 Share Posted July 16, 2007 Hi, Try ; _FileListToArrayTime.au3 #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray(@ScriptDir, "*.txt", 1) Local $ar_FileList2D[UBound($FileList) ][4] If @error = 1 Then MsgBox(0, "", "No Files\Folders Found.") Exit EndIf For $i = 1 To UBound($FileList) - 1 $ar_FileList2D[$i][0] = $FileList[$i] $ar_FileList2D[$i][2] = Round(FileGetSize($FileList[$i]) *1000/ 1048576, 2) local $i_posDot = StringInStr($FileList[$i], ".", 0, -1),$fgtime = "Unknown",$fgtime = FileGetTime($FileList[$i]) If @error <> 1 Then $ar_FileList2D[$i][1] = $fgtime[0] & "-" & $fgtime[1] & "-" & $fgtime[2] & ", " & $fgtime[3] & ":" & $fgtime[4];~ if $i_InternationalDateF then If $i_posDot Then $ar_FileList2D[$i][3] = StringMid($FileList[$i], $i_posDot + 1) Next _ArrayDisplay($ar_FileList2D, "$FileList")Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
bogQ Posted July 16, 2007 Author Share Posted July 16, 2007 (edited) ty 4 this #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray(@ScriptDir, "*.txt", 1) Local $ar_FileList2D[UBound($FileList) ][2] If @error = 1 Then MsgBox(0, "", "No Files\Folders Found.") Exit EndIf For $i = 1 To UBound($FileList) - 1 $ar_FileList2D[$i][0] = $FileList[$i] local $i_posDot = StringInStr($FileList[$i], ".", 0, -1),$fgtime = "Unknown",$fgtime = FileGetTime($FileList[$i]) If @error <> 1 Then $ar_FileList2D[$i][1] = $fgtime[0] & "/" & $fgtime[1] & "/" & $fgtime[2] Next _ArrayDisplay($ar_FileList2D, "$FileList") i still dono one thing, where did you finde $i_posDot and how you use it heare, is it something in Array.au3 or only with local command? and is there way to srot it on date colom rows becose i have some problems with _ArraySort command and error in line 680 in array.au3 file? Edited July 16, 2007 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
randallc Posted July 17, 2007 Share Posted July 17, 2007 Hi, $i_PosDot was just a variable name I made up and use that string function to find the strat of the extension in the filenames; not needed for time. Here is the sort.. ?is that what you meant?? ; filedetailarray2.au3 #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray(@ScriptDir, "*.txt", 1) Local $ar_FileList2D[UBound($FileList) ][2] If @error = 1 Then MsgBox(0, "", "No Files\Folders Found.") Exit EndIf For $i = 1 To UBound($FileList) - 1 $ar_FileList2D[$i][0] = $FileList[$i] Local $fgtime = "Unknown", $fgtime = FileGetTime($FileList[$i]) If @error <> 1 Then $ar_FileList2D[$i][1] = $fgtime[0] & "/" & $fgtime[1] & "/" & $fgtime[2] Next ;~ _ArraySort($ar_FileList2D, 0, 1, UBound($ar_FileList2D), UBound($ar_FileList2D, 0), 1); ascending ;~ _ArrayDisplay($ar_FileList2D, "Ascending $FileList") _ArraySort($ar_FileList2D, 1, 1, UBound($ar_FileList2D), UBound($ar_FileList2D, 0), 1); descending _ArrayDisplay($ar_FileList2D, "Descending $FileList")Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
bogQ Posted July 17, 2007 Author Share Posted July 17, 2007 it is, ty alot Randall 4 your help. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now