Jump to content

NoobieAutoitUser

Active Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by NoobieAutoitUser

  1. Yes, then the script runs after the time out. What I am trying to do is, when the script launches, it waits for a window to appear. If the window does not appear, it will exit the script. Easier said then done I am finding out Thanks for the input.
  2. Hello everybody thanks for looking at my question. I am trying to write a loop that will wait for a window to appear, and if it does not it will exit the script. If said window appears then it runs the script as normal. As you can see, I've been looking through the forums for answers (below is an example form here). I am 90 percent done, and this is all the hold me back. While True While True ; this is where you do your stuff WinWait("!My-Cell") ; whatever your condition is to leave the loop If True Then ExitLoop EndIf WEnd $i = TimerInit() While TimerDiff($i)<6*10 ; WEnd WEnd Full script below, ; #include <date.au3> ; !My-Cell FileDelete("name.txt") ; S - Wait for window to apear ;Look for Window for 10 Seconds if Not Found Exit Scirpt If WinWait("!My-Cell", "", 10) = 0 Then Exit WinActivate("!My-Cell") ; E - Wait for window to apear ; S - Begin Timeer to query window for text. $begin = TimerInit () While 1 $dif = TimerDiff ($begin) if $dif > 30000 then exitloop ; S - Send keys to pidgin to copy paste text to fiel and save Send("^l") winactivate("!My-Cell") Sleep(500) Send("!c") winactivate("!My-Cell") Sleep(500) Send("{RIGHT}") winactivate("!My-Cell") Sleep(500) Send("{RIGHT}") winactivate("!My-Cell") Sleep(500) send("{ENTER}") winactivate("!My-Cell") Sleep(500) Send("{F6}") winactivate("!My-Cell") Sleep(500) Send("^a") winactivate("!My-Cell") Sleep(500) Send("^c") winactivate("!My-Cell") Sleep(500) Send("^l") winactivate("!My-Cell") Sleep(500) ; E - Send keys to pidgin to copy paste text to fiel and save ; the & '@CRLF' adds a line break afer paste form clipboard filewrite(".txt",clipget() & @CRLF) sleep(10000) #include <MsgBoxConstants.au3> $AllText = FileRead(".txt") $textToFind = ("successfully refreshed") ;If StringInStr($AllText,$textToFind) <> 0 then If StringInStr($AllText,$textToFind) then ;it's there MsgBox($MB_OK, "Crap", "Yes") exitloop else ;it isn't there MsgBox($MB_OK, "Crap", "No") Sleep(100) endif ; E - Begin Timeer to query window for text. wend ; Start read form text fiel and send to pidgin #include <File.au3> $file = "name.txt" FileOpen($file, 0) For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) Send($line) Send("{ENTER}") Sleep(5000) Next FileClose($file) ; end read form text fiel and send to pidgin
  3. $txt is what is copied 'clip get'? Local $ClipTxtArray[5] <-- that is the array? Local $avLines = StringSplit( $txt, @CRLF, 1) <-- not sure I need that. _ArraySearch($ClipTxtArray, "g6g6g6g sf hgfhf") <--- searches Array for 'g6g6g6g sf hgfhf'? Their is a lot I am not sure of with this. I have read of this in the Help and the forums. I looked at the Bold stuff. Still is as clear as mud I don't want to do a file to do the search, as it will need to loop, until it finds the text. That will be many writes. Faster to do Array. Thanks for any pointers. Some I grasp, some I need to learn.
  4. Hi. I am currently writing a script for Pidgin (chatting/messaging) program. I am using OTR (off the record - encrypts the text/chat) with Pidgin on XMPP (Jabber). The goal is so when people login I can send them messages. Basically offline messaging. When you first send a message you need to wait for a second or two (sometime longer) for the message 'Successfully refreshed the' text to appear before the receiver gets the message. I have everything working great up to this point. I figured out how to 'copy and paste text' into an Array. The Array pops up a message box, so I see the text has been copied. How do i serach for the text in the Array, and have it loop as it waits for the text to appear? With a time out of 60 seconds. #include <Array.au3> Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) WinWait("Untitled - Notepad","") If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","") WinWaitActive("Untitled - Notepad","") Send("{CTRLDOWN}a{CTRLUP}") Send("{CTRLDOWN}c{CTRLUP}") $txt = ClipGet() StringSplit( $txt, @CRLF, 1) ;MsgBox(0,"test", $txt, 0) Local $ClipTxtArray[5] Local $avLines = StringSplit( $txt, @CRLF, 1) _ArrayDisplay($avLines)
  5. @TechCoder Again thanx for your input Over the last few years I have started to get real good at the 'command line' (Windows) and manipulating data that way. The 'command line is 'very limited' on what you can do. I started messing with Autoit a couple years ago, scripting some little stuff, and expanding my understanding of it. IMO I have written some pretty killer scripts. and I love the power of Autoit. Though I don't really understand some of it, I 'just' get it to work I have some experience with 'spread sheets' so I grasp the rows and columns (to a point). I also have learned how 'delimiters' work using the 'for' command of Windows, so I kinda understand how to 'break' my data up into pieces to work with. Delimiters can be anything '/,x, csv'. $pathtofolder[0] = 3 The above creates an Array of 3 blocks in a column? Also you can not have data at the root '[0]' of the Array? What if you don't know how many 'blocks' you going to need in a column? $pathtofolder[1] = folder1 $pathtofolder[2] = folder2 $pathtofolder[3] = folder3 The above the is assigned into a different box's after being chopped by the delimiter? Right now the biggest thing holding back my script is 'how do you search an Array' using '_ArrayBinarySearch'. _ArraySort($avArray) ; Lookup existing entry $iKeyIndex = _ArrayBinarySearch($avArray, $searchstring,1) If Not @error Then MsgBox(0, 'Entry found', ' Index:' & $iKeyIndex) Else MsgBox(0, 'Entry Not found', ' Error:' & @error) EndIf If the data is 'not found' it works perfect like that (it errors and does not run the rest of script). Though when the data is 'found' it still gives me an error and proceeds to run the rest of my script. I have spent a week after work, trying to figure this one out. I feel like I'm missing something really small. BTW I do read the help files when I get stuck. sometimes though you need to ask for help Again thanx for your input and direction
  6. @Danyfirex Thanx a lot for your replies. I will be able to look over the differences between my script and yours. Yours looks a lot cleaner then mine, though that has a lot to do with me trying to 'troubleshoot' mine Thanx again for your help BTW: what is tow time? @TechCoder A billion thanx as to laying the ground work for how array's work I read a while back somewhere that peeps new to programming struggle with arrays. That is why I was trying to script with this one, so I can slowly 'master it'. I have saved your reply as a text file so I can go back to it when I get lost again So lets say I have some data 'folder1folder2folder3 that I want to 'read' into an array. First I create an array calling it 'pathtofolder'. I then separate the 'data' from the ''. So then 'line 1' would be 'folder1' in the array, and 'line 2' would be 'folder2', and so on and so forth?
  7. I have tried (it works mostly) to create a script that opens a text file, and looks for specific data 'www.test.com'. Then it strips out everything that does not contain 'www.test.com'. Then outputs to a text file that only has the lines with 'www.test.com' in them. I'm trying to duplicate some of the functionality of SED (native to Linux, but I use the windows version). I created a script and it works beyond my dreams, I was ecstatic Then it dawned on me that I need to put in some error correction. In case the text file did not contain the data I was looking for. That is what slowed me down by a lot. The script works great except I can't figure out to search for a string in the array to see if it exists. That being the error correction. Most of my script I understand what I'm doing, but these 'array' things, are killing me I'm also getting stuck on the a loop. I want it to search for a string, if not found then 'error box', if found then to write a file. If any kind soul could point me in the right direction, I would appreciate it a lot. #include <file.au3> #include <Array.au3> Dim $array $s = _FileReadToArray("testreppb.txt", $array);read the text file to an array of lines FileDelete ( "converted.txt" ) $value = InputBox("Input Box","Text to search") ClipPut($value) $bak = ClipGet() ; MsgBox(0, "Clipboard contains:", $bak) $file = FileOpen("converted.txt", 2);open the file to write the results to $searchstring = $bak MsgBox(0, "", $searchstring) _ArrayDisplay($array, "$avArray") Local $avArray = $array $searchstring = InputBox("_ArraySearch() demo", "String to find?") $iIndex = _ArraySearch($avArray, $searchstring) ; MsgBox(0, "test", $iIndex) If @error Then MsgBox(0, "Not Found", $searchstring) Else MsgBox(0, "Found", $searchstring) EndIf for $n = 0 to $array[0] if StringInStr($array[$n],$searchstring) then MsgBox(0, "file write", $array[$n]) endif next
  8. I hope I am posting in the right forum. After a lot of time, and effort, I have discovered how to do event logs with autoit. BTW: Autoit is an excellent tool. As the title says no DLL. I did a lot of searching on the forums, and never really found a way. The ones I found would not do "line breaks" correctly. I saw quite a few involving a DLL, but I have no clue how to do that! This works on Windows 7 natively, but earlier versions may need to download the "resource kit". I have created a script that reads the output (a text file) of a command line virus scanner (a2cmd if you were curious). This way I can right click a folder, and and scan that folder. I created a "custom" log in "event viewer". Using this utility: Event Log Creation Utility. This way I have a snazzy way of keeping track of virus scans. When I do get one, I open "event viewer". Grab the name of it, and then Google it. This is the "command line" that starts it going. a2cmd.exe /f="%1" /r /n /l=d:\\a2cmd\\a2cmd.log & d:\\a2cmd\\testing.au3 & pause" This is the script that does the writing to "event viewer". #include <Array.au3> $text = FileRead("D:\A2cmd\a2cmd.log") Run("eventcreate /T Information /ID 100 /L Virus-Log /SO Anti-Virus /D " & CHR(34) & $text & CHR(34), "", @SW_HIDE, 2) This the reg file that gives you the right click option. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\a2cmd] @="Emsisoft Commandline Scanner" [HKEY_CLASSES_ROOT\Directory\shell\a2cmd\command] @="cmd /c D:\\A2cmd\\a2cmd.exe /f=\"%1\" /r /n /l=d:\\a2cmd\\a2cmd.log & d:\\a2cmd\\testing.au3 & pause" The output looks like this. How it looks here, is how it look in "event viewer". Emsisoft Commandline Scanner v. 5.1.0.2 (C) 2003-2010 Emsi Software GmbH - www.emsisoft.com Emsisoft Commandline Scanner - Version 5.1 Last update: 4/18/2011 6:11:04 PM Scan settings: Objects: D:\TEMP Scan archives: Off Heuristics: Off ADS Scan: On Scan start: 5/24/2011 7:34:17 PM D:\TEMP\file.txt Scanned Files: 1 Traces: 0 Cookies: 0 Processes: 0 Found Files: 0 Traces: 0 Cookies: 0 Processes: 0 Scan end: 5/24/2011 7:34:26 PM I hope all this makes sense. I will try to answer any questions about this.
  9. Dood, This thing is fantastic. It took just a hair over a minute to scan 13,823 @ 3.06 GB worth of files. THanx a billion again!!!! EDIT: Typo
  10. @smartee Worked perfectly. Thanks a lot. The whole thing I was missing was putting the "open dialog" at the top, cause where I was putting it was causing it to loop per line? right?
  11. Hi peeps. I am trying to use the code below, and output the results to a text file. I would like to be able to choose what ever name I want for the output file. #include <Array.au3> #include <file.au3> Dim $FileArray, $BigArray[1][3], $MidArray, $temp ; $FileArray = _FileListToArray("F:\nicole-here\052") $fold = FileSelectFolder("Choose a folder.", "") ; $FileArray = _FileListToArray("$fold") $FileArray =_FileListToArray($fold,"*",1) ReDim $BigArray[$FileArray[0]][3] ;will hold all the file names split by "-" Dim $MidArray[$FileArray[0]] ;will hold the mid number (FC) For $i = 1 To $FileArray[0] $temp = StringSplit($FileArray[$i], "-") For $j = 1 To $temp[0] $BigArray[$i-1][$j-1] = $temp[$j] ;put the value in the big array If $j = 2 Then $MidArray[$i-1] = $temp[$j] ;put middle string in $MidArray Next Next ;_ArrayDisplay($BigArray, "Big") ;_ArrayDisplay($MidArray, "Mid") Dim $UniqueArray, $tempArray, $ResultArray $UniqueArray = _ArrayUnique($MidArray) ;get unique mid-strings ;_ArrayDisplay($UniqueArray, "Unique") For $i = 1 To UBound($UniqueArray)-1 $tempArray = _ArrayFindAll($BigArray, $UniqueArray[$i], 0, 0, 0, 0, 1) ;get all array indexes for the same mid-string ;_ArrayDisplay($tempArray, "Find"&$UniqueArray[$i]) Dim $ResultArray[UBound($tempArray)][3] For $j = 0 To UBound($tempArray) - 1 ;build a temporary array to hold these entries $ResultArray[$j][0] = $BigArray[$tempArray[$j]][0] $ResultArray[$j][1] = $BigArray[$tempArray[$j]][1] $ResultArray[$j][2] = $BigArray[$tempArray[$j]][2] Next _ArraySort($ResultArray, 0, 0, 0, 2) For $k = Number($ResultArray[0][2]) To Number($ResultArray[UBound($ResultArray)-1][2]) If _ArraySearch($ResultArray, $k, 0, 0, 0, 0, 1, 2) <> -1 Then ContinueLoop Else ; MsgBox(0, "Missing File", $ResultArray[0][0]&"-"&$ResultArray[0][1]&"-"&StringFormat("%03d", $k)) ; $file = FileOpen("f:\file.txt", 1) ; $save = FileSaveDialog("Choose a name and location to save.", @WorkingDir, "Jpg (*.jpg)", 18) & ".jpg" ; $save = save1 ; FileWriteLine($save, $ResultArray[0][0]&"-"&$ResultArray[0][1]&"-"&StringFormat("%03d", $k)) ; $save = FileSaveDialog("Choose a name and location to save.", @WorkingDir, "Txt (*.txt)") $SaveFile = FileSaveDialog('Would You like to save your array', '', 'Text Files (*.txt)', 2, 'Array.txt') If @error Then Exit _FileWriteFromArray($SaveFile, $ResultArray[0][0]&"-"&$ResultArray[0][1]&"-"&StringFormat("%03d", $k)) EndIf Next Next I am having trouble with the below code. Autoit prompts me every time it writes a line to to the text file. Also the file "Array.txt" is not being written to. I created the file "Array.txt" to see if that would help. It did not. $SaveFile = FileSaveDialog('Would You like to save your array', '', 'Text Files (*.txt)', 2, 'Array.txt') If @error Then Exit _FileWriteFromArray($SaveFile, $ResultArray[0][0]&"-"&$ResultArray[0][1]&"-"&StringFormat("%03d", $k)) Any help will be appreciated.
  12. Howdy peeps. I have a couple of Autoit scripts with arrays in them. They have the output file (Hardcoded) into them. I really would like to be prompted where to save the files, and give it a file name. I have a "FileWriteLine" (see second code snip) setup. Though it prompts me to save every line from the array. How do I get just one file save? Thanx for any input into this matter. #include <Array.au3> #include <file.au3> Dim $FileArray, $BigArray[1][3], $MidArray, $temp ; $FileArray = _FileListToArray("F:\nicole-here\052") $fold = FileSelectFolder("Choose a folder.", "") ; $FileArray = _FileListToArray("$fold") $FileArray =_FileListToArray($fold,"*",1) ReDim $BigArray[$FileArray[0]][3] ;will hold all the file names split by "-" Dim $MidArray[$FileArray[0]] ;will hold the mid number (FC) For $i = 1 To $FileArray[0] $temp = StringSplit($FileArray[$i], "-") For $j = 1 To $temp[0] $BigArray[$i-1][$j-1] = $temp[$j] ;put the value in the big array If $j = 2 Then $MidArray[$i-1] = $temp[$j] ;put middle string in $MidArray Next Next ;_ArrayDisplay($BigArray, "Big") ;_ArrayDisplay($MidArray, "Mid") Dim $UniqueArray, $tempArray, $ResultArray $UniqueArray = _ArrayUnique($MidArray) ;get unique mid-strings ;_ArrayDisplay($UniqueArray, "Unique") For $i = 1 To UBound($UniqueArray)-1 $tempArray = _ArrayFindAll($BigArray, $UniqueArray[$i], 0, 0, 0, 0, 1) ;get all array indexes for the same mid-string ;_ArrayDisplay($tempArray, "Find"&$UniqueArray[$i]) Dim $ResultArray[UBound($tempArray)][3] For $j = 0 To UBound($tempArray) - 1 ;build a temporary array to hold these entries $ResultArray[$j][0] = $BigArray[$tempArray[$j]][0] $ResultArray[$j][1] = $BigArray[$tempArray[$j]][1] $ResultArray[$j][2] = $BigArray[$tempArray[$j]][2] Next _ArraySort($ResultArray, 0, 0, 0, 2) For $k = Number($ResultArray[0][2]) To Number($ResultArray[UBound($ResultArray)-1][2]) If _ArraySearch($ResultArray, $k, 0, 0, 0, 0, 1, 2) <> -1 Then ContinueLoop Else ; MsgBox(0, "Missing File", $ResultArray[0][0]&"-"&$ResultArray[0][1]&"-"&StringFormat("%03d", $k)) ; $file = FileOpen("f:\file.txt", 1) ; $save = FileSaveDialog("Choose a name and location to save.", @WorkingDir, "Jpg (*.jpg)", 18) & ".jpg" $save = FileSaveDialog("Choose a name and location to save.", @WorkingDir, "Txt (*.txt)") FileWriteLine($save, $ResultArray[0][0]&"-"&$ResultArray[0][1]&"-"&StringFormat("%03d", $k)) EndIf Next Next $save = FileSaveDialog("Choose a name and location to save.", @WorkingDir, "Txt (*.txt)") FileWriteLine($save, $ResultArray[0][0]&"-"&$ResultArray[0][1]&"-"&StringFormat("%03d", $k))
  13. I figured out what the problem was. $FileArray =_FileListToArray($fold,"*.",1) I removed the "." after the "*". Now everything works right. Thanks again for your help. This script is going to save me hours of time. EDIT: Fixed a typo.
  14. ReDim $BigArray[$FileArray[0]][3] Error ^ I changed the line (sorry I need to go to bed) I'm getting the same error messge. I dont have a clue what to do with "redim".
  15. I use this program to "telnet" to my ISP's mail server, and delete my email. Its called "Telnet Scripting Tool a.k.a TST10.exe". As the title says, you can script with it. I hope this is what you were looking for. Good luck. http://jerrymannel.com/blog/2008/11/11/telnet-scripting-tool-aka-tst10exe/ http://blog.cleannet.co.th/?p=165 From what I gather is it is freeware. Though I could be wrong.
  16. @enaiman Yup "MsgBox with FileWriteLine" worked great. I'm having a heck of a time trying to get "browse to folder" working, This is the code where I am stuck at. The last line is where the error is coming from. Any ideas what I am doing wrong. I have a feeling it has something to do with the "Dim" function. Thanx again for your help. #include <Array.au3> #include <file.au3> Dim $FileArray, $BigArray[1][3], $MidArray, $temp ; $FileArray = _FileListToArray("F:\filename-here\052") $fold = FileSelectFolder("Choose a folder.", "") $FileArray =_FileListToArray($fold,"*.",2) ReDim $BigArray[$FileArray[0]][3] ;will hold all the file names split by "-"
  17. @enaiman You sir are a God at this. It works perfectly. I expected a few pointers to get started with. After looking at the code, I'm sure glad I asked first A couple things I will need to add to "polish" this. Like a "browse to folder". Could you throw a couple pointers on how to output all the missing files to a text file. I don't want you to do the work, but give me a few examples. Thank you for taking the time to help me with this.
  18. Howdy all. I would like to create a script that will scan a folder, see how many "filename-001" (FC) files there are, and look for highest number in the "filename-***-001" column (SC). Then display what files are missing in the second column. Below there are 2 groups of files. The first 5 files within the first column (FC) being -001-. There are also 5 files with the (SC) number starting at -001- and going to -005-. The second group of 5 files within the first column (FC) being -002-. There are also 5 files with the (SC) number starting at -001 and going to -005. FC= First column. SC= Second column. FC SC filename-001-001 filename-001-002 filename-001-003 filename-001-004 filename-001-005 filename-002-001 filename-002-002 filename-002-003 filename-002-004 filename-002-005 Below are the same two groups of files. Missing is file 3 of group 1. Also missing is 4 of group 2. FC SC filename-001-001 filename-001-002 filename-001-004 filename-001-005 filename-002-001 filename-002-002 filename-002-003 filename-002-005 What I would like to do is display what files are missing. Any suggestions on where to start. I am motivated to make this work, as it will save me a lot of time and energy Thanx for any input.
  19. @Melba23 You misunderstand. You have no idea how happy I was to see that script spit out "ouput.txt" with things the way the were supposed to be. I have been trying to do something like this for a little over a year. You are correct I did not ask the question right, and I humbly ask for forgiveness. I did not know that in order for your script to work that I had to use the same amount of lines in both text files (See Below). Chalk that up to a learning experience. Above was my first reply to your script. After a few replies from "Realm" I came to the conclusion that I needed to make the lines in the text files the same. A big thanx goes out to "Realm" for his help. @hot202 I have never done anything to you. Why did you come into my post throwing crap around? Again I say thank you to "Melba23", and "Realm" for helping with this. Without both of you I would still be trying to get this to work. I am sure that there are a lot of ungrateful peeps out there, but I am not one one them. FYI: This is my second posting here asking for help. To be honest some peeps are quick to get an attitude. Not trying to be a smart ass here, but if someone is asking for help, means they don't quite understand what they are doing, and they need help.
  20. @Realm Thanx again for trying to help. If time, and money were not an issue I would love to take a class on how to do this Moving on, I tried your updated code. I got an error on line 30. I then made both of the text files (show1.txt, and show2.txt) have the same amount of lines (24). I tried your script again, and got an error on line 30. I went back to the original script. Tried with non-even lines, and got the same error as before. I then made both of the text files (show1.txt, and show2.txt) have the same amount of lines (24). Ran the original script (to my surprise) it worked perfectly. After all the hell, I am happy that I have something that works. Now I need to move on to figuring out how to "tweak" the code to work with different length files. I am thinking that I need to "parse" the text files before they go into the array (I wish I would have known that having different length files would cause all this headache). Do you have any pointers on where to start on this? I can see me relying on this heavily as I watch a lot of TV stuff on my computer. I would really like to make this a "nice" program, that I can give away as freeware. Again thanx to everyone that helped to contribute to this cause.
  21. This is my goal: Show1.txt 01x01 one 01x02 one 01x03 one Show2.txt 01x01 two 01x02 two 01x03 two I would like to merge these two files into one file. Output.txt 01x01 one 01x01 two 01x02 one 01x02 two 01x03 one 01x03 two See how I am trying to stagger the output? I am trying to make a play-list (can't seem to find one out there in freeware land. Plus once I tweak this, I can "up" it here for other peeps that might like it. Its for Media Player Classic). Again thanx for your help in this matter.
  22. @Realm I am getting a error message with the script you posted. It says the error is at "line 6" The error message is "Error in expression". Is there a way to pipe error messages to a text file? Do the contents of "show1.txt, and "show2.txt" to have an equal amount of lines. Because they do not. One has 12 (show1.txt) entries, while the other has 7 (show2.txt) entries. Again thanx for your help in this. I am pulling my hair out trying to understand what is wrong here.
  23. Lol, there has been a misunderstanding. The script still gives the same error. I have both the files in the same folder. I'm not understanding what I am missing here. To recap I am still getting this error message: The error is here "$aFile_New[(2 * $i) - 1] = $aFile_Show2[$i]" The error message is this: "Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded." Any help, or insight into what I am missing will be appreciated. The whole code is below. #include <Array.au3> #include <File.au3> ; Get the files into arrays Global $aFile_Show1, $aFile_Show2 _FileReadToArray("E:\Autoit\Show1.txt", $aFile_Show1) _FileReadToArray("E:\Autoit\Show2.txt", $aFile_Show2) ; And display them to show you what they look like _ArrayDisplay($aFile_Show1) _ArrayDisplay($aFile_Show2) ; Prepare the new array big enough to hold both files Global $aFile_New[$aFile_Show1[0] * 2] ; Now transfer the lines For $i = 1 To $aFile_Show1[0] $aFile_New[(2 * $i) - 2] = $aFile_Show1[$i] $aFile_New[(2 * $i) - 1] = $aFile_Show2[$i] Next ; And here is the result _ArrayDisplay($aFile_New) ; Which we write to disk _FileWriteFromArray("Output.txt", $aFile_New) Directory listing showing "show1.txt, and "show2.txt" are in the same folder. Directory of E:\Autoit 10/18/2010 05:34 PM <DIR> . 10/18/2010 05:34 PM <DIR> .. 09/21/2010 01:13 PM <DIR> AutoIt-Temp 09/06/2010 12:31 PM <DIR> bru 10/18/2010 02:08 PM <DIR> Bulk_Rename 10/18/2010 05:34 PM 0 dir.txt 10/18/2010 02:08 PM <DIR> Hulu 09/06/2010 12:30 PM <DIR> new-autoit-crap 10/18/2010 04:43 PM 1,522 Output.txt 09/06/2010 12:30 PM <DIR> Playlist 10/18/2010 05:02 PM 231 playlist.au3 10/18/2010 05:23 PM 726 Playlist_Maker_(MPC).au3 10/18/2010 02:09 PM 759 show1.txt <--------------------- 10/18/2010 02:09 PM 557 show2.txt <--------------------- 10/12/2010 05:02 PM 420 temp-playlist-maker.au3 10/12/2010 04:17 PM 545 temp.mpcpl.txt 10/18/2010 02:51 PM 347 test.au3 10/18/2010 02:09 PM 557 test.txt 10/18/2010 02:54 PM 113 working.au3 09/06/2010 12:30 PM <DIR> Yahoo-autoit 11 File(s) 5,777 bytes 9 Dir(s) 5,158,113,280 bytes free
  24. Ok both files are in same folder (they have been the whole time). Thanx for your helping in this matter. Directory of E:\Autoit 10/18/2010 05:34 PM <DIR> . 10/18/2010 05:34 PM <DIR> .. 09/21/2010 01:13 PM <DIR> AutoIt-Temp 09/06/2010 12:31 PM <DIR> bru 10/18/2010 02:08 PM <DIR> Bulk_Rename 10/18/2010 05:34 PM 0 dir.txt 10/18/2010 02:08 PM <DIR> Hulu 09/06/2010 12:30 PM <DIR> new-autoit-crap 10/18/2010 04:43 PM 1,522 Output.txt 09/06/2010 12:30 PM <DIR> Playlist 10/18/2010 05:02 PM 231 playlist.au3 10/18/2010 05:23 PM 726 Playlist_Maker_(MPC).au3 10/18/2010 02:09 PM 759 show1.txt <-------------------------------------------------------- 10/18/2010 02:09 PM 557 show2.txt <-------------------------------------------------------- 10/12/2010 05:02 PM 420 temp-playlist-maker.au3 10/12/2010 04:17 PM 545 temp.mpcpl.txt 10/18/2010 02:51 PM 347 test.au3 10/18/2010 02:09 PM 557 test.txt 10/18/2010 02:54 PM 113 working.au3 09/06/2010 12:30 PM <DIR> Yahoo-autoit 11 File(s) 5,777 bytes 9 Dir(s) 5,158,113,280 bytes free
  25. Updated code with the paths changed. The files are both in the same folder as each other, do I need to put them in different folders? #include <Array.au3> #include <File.au3> ; Get the files into arrays Global $aFile_Show1, $aFile_Show2 _FileReadToArray("E:\Autoit\Show1.txt", $aFile_Show1) _FileReadToArray("E:\Autoit\Show2.txt", $aFile_Show2) ; And display them to show you what they look like _ArrayDisplay($aFile_Show1) _ArrayDisplay($aFile_Show2) ; Prepare the new array big enough to hold both files Global $aFile_New[$aFile_Show1[0] * 2] ; Now transfer the lines For $i = 1 To $aFile_Show1[0] $aFile_New[(2 * $i) - 2] = $aFile_Show1[$i] $aFile_New[(2 * $i) - 1] = $aFile_Show2[$i] Next ; And here is the result _ArrayDisplay($aFile_New) ; Which we write to disk _FileWriteFromArray("Output.txt", $aFile_New)
×
×
  • Create New...