iceberg Posted June 24, 2008 Share Posted June 24, 2008 hi guys, i remember there was a post on this....i tried searching for it but cdn't locate it. would appreciate if someone could direct me to it by providing the link to the post. thanks. mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
Zedna Posted June 24, 2008 Share Posted June 24, 2008 Use RunWait() with this: copy file1.txt + file2.txt + file3.txt file_out.txt Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
qazwsx Posted June 24, 2008 Share Posted June 24, 2008 you could also use a for loop to write the command to a .bat file so you don't have to type so much, and then you could run the .bat file. Link to comment Share on other sites More sharing options...
GEOSoft Posted June 24, 2008 Share Posted June 24, 2008 If the files are all in one folder then you could just use _FileListToArray() and then loop through the array. Where $fList is the array returned from _FileListToArray() If IsArray($flist) Then $Out = "" For $I = 1 To Ubound($fList)-1 $Out &= FileRead($fList[$I]) & @CRLF Next FileWrite("My_New_File.txt", StringStripWs($Out, 2)) EndIf George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
iceberg Posted June 24, 2008 Author Share Posted June 24, 2008 thanks alot everyone! mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
nobbe Posted June 25, 2008 Share Posted June 25, 2008 or Use RunWait() with this: "type *.csv >> test.txt" Link to comment Share on other sites More sharing options...
iceberg Posted June 26, 2008 Author Share Posted June 26, 2008 hi all, i managed to resolve the issue in this manner. thanks for all your help anyway. $search = FileFindFirstFile("*.txt") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern - *.txt") Exit EndIf $x = 0 While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $open = FileOpen($file, 0) If $open = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $x = $x + 1 $chars = FileRead($open) If @error = -1 Then ExitLoop ;MsgBox(0, "Char read:", $chars) FileWrite("output.doc", $chars & @CRLF) FileClose($file) SplashTextOn("Monitor Status", "Current File : " & $file & @CRLF & "Number of files processed : " & $x, 400, 50, -1, -1, 33, "", 12) WEnd SplashOff() FileClose($search) MsgBox(0, "Status", "All completed.") Exit mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
dorit30 Posted June 26, 2008 Share Posted June 26, 2008 There is Udf (Sorry i cant rem. who post it ) but its not mine CODEFunc _FileGetNewest($s_Path = @MyDocumentsDir, $s_Mask = '*', $i_Flags = 1) Dim $a_File, $s_NewestFileName = '', $s_NewestFileDate = '', $s_FileName = '', $s_FileDate = '' $a_File = _FileListToArray($s_Path, $s_Mask, $i_Flags) If Not @error Then For $i = 1 To $a_File[0] $s_FileName = $s_Path & '\' & $a_File[$i] $s_FileDate = FileGetTime($s_FileName, 0, 1) If $s_FileDate > $s_NewestFileDate Then $s_NewestFileName = $s_FileName $s_NewestFileDate = $s_FileDate EndIf Next EndIf Return $s_NewestFileName EndFunc 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