Jump to content

NoobieAutoitUser

Active Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by NoobieAutoitUser

  1. @Realm #include <Array.au3> #include <File.au3> ; Get the files into arrays Global $aFile_Show1, $aFile_Show2 _FileReadToArray("Show1.txt", $aFile_Show1) _FileReadToArray("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) This is the code I am using from "Melba23".
  2. @Melba23 Thanx for your reply. I checked out the link about "arrays". Wow talk about intimidating a n00bie From what I gathered that is a good tutorial. I shall reference that in the future as I build more complex scripts. Now for the bad news. I am getting an error on the code you posted. 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." From my limited understanding of whats going on, it looks like "$aFile_Show2" has not been "declared". Any more input, or help will be appreciated.
  3. Howdy all. I could you someones help here. I have two text files. 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 I've read through the help file. Also have been spending time in the forums. I'm not sure what to do here. I see references to put the data in an "array", but I have no clue what an "array" is, let alone how to manipulate the data in an "array". Also how does one edit there post to put "solved" in the title. Last time I posted I could not figure out how to do that. Again thanx for any help here.
  4. @ AlmarM You Sir are really good at this. If I could buy you a beer I would Is there anyway to put "Solved" in the topic header?
  5. @ AlmarM You Sir are "The Man". Thanx a billion for your help. That works perfectly. I am glad I asked for help, as looking at your code, I would have never figured that out on my own. I tweaked the "code" to see if it would work: ; Global $Path = @DesktopDir & "\url.txt" $hFileOpen = FileOpen("url.txt", 0) $hFileRead = FileRead($hFileOpen) $iTotalLines = StringSplit($hFileRead, Chr(10)) For $i = 1 To $iTotalLines[0] $sLineRead = FileReadLine($hFileOpen, $i) ;MsgBox(0, "", "Replace this msgbox with your code to paste it into the address bar." & @CRLF & _ ;@CRLF & "Current line: " & $i & @CRLF & "Current line read: " & $sLineRead) clipput($sLineRead) Sleep(500) ; (1000 * 60) * 60) ; 1000ms * 60 = 1 min * 60 is 60 min Next FileClose($hFileOpen) With your orginal code (untouched by me) I was getting an error on line 15. I have no line 15 in the "url.txt" file. Current line: 15 Current line read: is blank. Its not a big deal as the script will be done by that line, I'm just curious why I'm getting that.
  6. @ omikron48 This is very close to what I need to do (A million thanks). I have some more questions for you. What I am trying to do is: Read line 1 paste line 1 into the address bar of a "web browser". wait an hour. read line 2 paste line 2 into the address bar of a "web browser". wait an hour. Read line 3 paste line 3 into the address bar of a "web browser". wait an hour. repeat till end of file. Once I get the above to work right, I think I'll have this son of a b**** working.
  7. Howdy folks. I am need of some help. I have been reading the help file, and looking through here. I have not quite found what I'm looking for. what I am trying to do is read a the first line of a text file, have Autoit do something with the first line, then come back and get the second line, and repeat. I have the open file, and read file line down (I think). What I can't figure out is how to make Autoit "do something", then come back and read the next line, and repeat this till its done. I have the filecountlines working. ; begin- count lines in file #include <File.au3> $txtfile="url.txt" $lines = _FileCountLines($txtfile) ; MsgBox(64, "Lines", "There are " & $lines & " lines in your file.") ; end- file line count ; begin- increase filereadline by one $x= 1 do $file = FileOpen("url.txt", 0) $Number = FileReadline($file, $x) ; MsgBox(0, "Line "&$x, $Number) clipput($Number) $x +=1 Until $x=$lines FileClose($file) ; end- done increase by 1 The above is just an example of the snippets of code I have tried. Like I said I think I have the read file, and count lines right, but how do you do "just one at a time"? If I need to clarify anything please let me know, and please someone help with this. I am just starting to get good at using Autoit, but this is starting to IRK me. Thanx for any replies.
×
×
  • Create New...