Pignara Posted March 12, 2007 Share Posted March 12, 2007 Hi, I need to create an output.lst file from a log folder. The output.lst must have this format: filename;Patch|Sizelike recovery.log;C:\Recovery\Log\|1276 log_06.03.2007.txt;C:\Recovery\Log\|1800 I figured out how to output the filelist #NoTrayIcon Dim $Logdir = @ScriptDir & '\Logs\' $LogFolders = _FileListToArrayEx($Logdir, '*.log; *.txt; *.rtf') $s_FileList = _ArrayToString($LogFolders, "*",1) $a_FileList = StringSplit($s_FileList, "*") $s_OutFile = @ScriptDir & '\output.lst' _FileWriteFromArray($s_OutFile, $a_FileList) but I'm stuck adding Patch & Size to each line... Any help is really appreciate Link to comment Share on other sites More sharing options...
xcal Posted March 12, 2007 Share Posted March 12, 2007 Try this (change the path, of course, and run it in scite): $path = @MyDocumentsDir & '\' $first = FileFindFirstFile($path & '*.*') While 1 $next = FileFindNextFile($first) If @error Then ExitLoop If StringInStr(FileGetAttrib($path & $next), 'D') Then ContinueLoop ConsoleWrite($next & ';' & $path & '|' & FileGetSize($path & $next) & @LF) WEnd How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Pignara Posted March 12, 2007 Author Share Posted March 12, 2007 Try this (change the path, of course, and run it in scite): $path = @MyDocumentsDir & '\' $first = FileFindFirstFile($path & '*.*') While 1 $next = FileFindNextFile($first) If @error Then ExitLoop If StringInStr(FileGetAttrib($path & $next), 'D') Then ContinueLoop ConsoleWrite($next & ';' & $path & '|' & FileGetSize($path & $next) & @LF) WEnd Tested in scite, all went fine. I'am an NOOB ans say me that I'm stupid but how can "fisically" create the output.lst? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 12, 2007 Moderators Share Posted March 12, 2007 FileClose(FileOpen('Output.lst', 2)) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Pignara Posted March 12, 2007 Author Share Posted March 12, 2007 FileClose(FileOpen('Output.lst', 2))I don't understand. Please show me a sample script that create and write the output.lst. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 12, 2007 Moderators Share Posted March 12, 2007 I don't understand. Please show me a sample script that create and write the output.lst.It creates a file.Then you use FileWrite to write to the file.Look at FileWrite in the help file for the example. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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