LHCompter Posted August 21, 2018 Share Posted August 21, 2018 (edited) Any idea why it does not read next line on EGL.LIST file ? :/ Ex : #include <file.au3> ;Local For Looper Increment Function$lineset = 1 $n = 1 ;Locals for email list$LEGL = "EGL.LIST" ;EGL ( EMAIL GENERATOR LIST | LEGL LOCATION EMAIL GENERATOR LIST);Open File And Read It Local $hLEGL = FileOpen ($LEGL, $FO_READ) ;hLEGL variable to setup external file reading;Read File Local $EGLL = FileReadLine($hLEGL,$lineset) Call("increment") func increment() While $n = 1 $lineset = $lineset + 1;Debuger MsgBox($MB_SYSTEMMODAL, "", "EGL LINE : " & @CRLF & $EGLL) ; EGL1 EMAIL GENERATOR LIST LINEMsgBox($MB_SYSTEMMODAL, "", "Line: " & @CRLF & $lineset) ; Line Set = value of line readerWEnd Edited August 21, 2018 by LHCompter Link to comment Share on other sites More sharing options...
careca Posted August 21, 2018 Share Posted August 21, 2018 You dont have the line that reads in the loop.. #include <file.au3> ;Local For Looper Increment Function $lineset = 1 $n = 1 ;Locals for email list $LEGL = "EGL.LIST" ;EGL ( EMAIL GENERATOR LIST | LEGL LOCATION EMAIL GENERATOR LIST) ;Open File And Read It Local $hLEGL = FileOpen ($LEGL, $FO_READ) ;hLEGL variable to setup external file reading ;Read File Local $EGLL = FileReadLine($hLEGL,$lineset) Call("increment") func increment() While $n = 1 $lineset = $lineset + 1 ;Debuger $EGLL = FileReadLine($hLEGL,$lineset) ;<<<<<<<<<<<<<< MsgBox($MB_SYSTEMMODAL, "", "EGL LINE : " & @CRLF & $EGLL) ; EGL1 EMAIL GENERATOR LIST LINE MsgBox($MB_SYSTEMMODAL, "", "Line: " & @CRLF & $lineset) ; Line Set = value of line reader WEnd EndFunc A better way to do this would be to count the lines and do a "for" loop to the count number. Earthshine and LHCompter 2 Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
LHCompter Posted August 21, 2018 Author Share Posted August 21, 2018 (edited) God damn,thanks bro,you just saved my life Edited August 21, 2018 by LHCompter Link to comment Share on other sites More sharing options...
careca Posted August 21, 2018 Share Posted August 21, 2018 In case u're interested in what i meant: #include <file.au3> ;Local For Looper Increment Function $lineset = 1 $n = 1 ;Locals for email list $LEGL = "EGL.LIST" ;EGL ( EMAIL GENERATOR LIST | LEGL LOCATION EMAIL GENERATOR LIST) ;Open File And Read It Local $hLEGL = FileOpen ($LEGL, $FO_READ) ;hLEGL variable to setup external file reading ;Read File Global $Count = _FileCountLines($LEGL) ReadLines() Func ReadLines() For $n=1 To $Count $EGLL = FileReadLine($hLEGL,$n) ConsoleWrite($EGLL &@CRLF) ;MsgBox($MB_SYSTEMMODAL, "", "EGL LINE : " & @CRLF & $EGLL) ; EGL1 EMAIL GENERATOR LIST LINE ;MsgBox($MB_SYSTEMMODAL, "", "Line: " & @CRLF & $lineset) ; Line Set = value of line reader Next EndFunc LHCompter 1 Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
LHCompter Posted August 21, 2018 Author Share Posted August 21, 2018 Yes I am,thanks again,now it's a faster way to see all the lines from that file Link to comment Share on other sites More sharing options...
BrewManNH Posted August 21, 2018 Share Posted August 21, 2018 If you're going to read the file sequentially, this way is much faster. #include <file.au3> ;Locals for email list $LEGL = "EGL.LIST" ;EGL ( EMAIL GENERATOR LIST | LEGL LOCATION EMAIL GENERATOR LIST) ;Open File And Read It Global $hLEGL = FileOpen($LEGL, $FO_READ) ;hLEGL variable to setup external file reading ;Read File ;~ Global $Count = _FileCountLines($LEGL) ReadLines() Func ReadLines() While 1 $EGLL = FileReadLine($hLEGL) If @error <> 0 Then ExitLoop ConsoleWrite($EGLL & @CRLF) ;MsgBox($MB_SYSTEMMODAL, "", "EGL LINE : " & @CRLF & $EGLL) ; EGL1 EMAIL GENERATOR LIST LINE ;MsgBox($MB_SYSTEMMODAL, "", "Line: " & @CRLF & $lineset) ; Line Set = value of line reader WEnd EndFunc ;==>ReadLines LHCompter and careca 1 1 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
LHCompter Posted August 21, 2018 Author Share Posted August 21, 2018 Aweomse methods but is there any way to call the value from that read line ? For example to call first line and after it finishes his job with that line to autoincrement and call the next line from the same file Link to comment Share on other sites More sharing options...
careca Posted August 21, 2018 Share Posted August 21, 2018 Not sure i got the question right. Do you really mean increment, or maybe it's concatenate? LHCompter 1 Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
LHCompter Posted August 21, 2018 Author Share Posted August 21, 2018 Well for example I want that the program make this thing first he reads the line so in values that will be $line1 $file = "file.txt" after he reads that line I want that he make a msgbox and say "hi the line 1 : this is line one" after that I want he ingrese the lines so that will be $line1 = $line + 1 $file = "file.txt" msgbox ( "hi this is line 2 : this is line two) and I want that he loops this procese :/ Link to comment Share on other sites More sharing options...
LHCompter Posted August 21, 2018 Author Share Posted August 21, 2018 I am such noob...nevermind guys thanks for your methods I found I way to do what I want using your code lines,thanks again Link to comment Share on other sites More sharing options...
jchd Posted August 22, 2018 Share Posted August 22, 2018 @careca It's dramatically inefficient to first invoke _FileCountLines() then have a For loop using that count with a FileReadLine($h, $n) to read $n-th line! With this you are doing all of the following block N+1 times if the files has N lines: open the file, read the file, split the file in lines, close the file. Better use @BrewManNH code or FileReadToArray() and read in the array. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
careca Posted August 22, 2018 Share Posted August 22, 2018 I thought it was, if anything, at least as efficient. Never timed it to know for sure. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe 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