Jump to content

Running through entire text file $ArrayEmail[1]


Recommended Posts

While 1

        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $idOK


                Local $emails = "email.txt" ;sets file path
                Local $pwd = "pwd.txt" ;sets file path
                Local $ArrayEmail[2], $ArrayPwd[2] ;declares array for email & pwd .txt

                _FileReadToArray($emails, $ArrayEmail) ;converts .txt file to array
                _FileReadToArray($pwd, $ArrayPwd);converts .txt file to array
                $username = $ArrayEmail[1]
                ; username variable
                $password = $ArrayPwd[1]

right now the ArrayEmail[1] read the first line in the file and inputs it, would it be possible to run trough the entire files lines instead of 1 line?
I would have to make some sort of variable I guess, tried with ubound but it didn't really work....

Thanks in advance

Link to comment
Share on other sites

You need to use a Loop statement. This is described in the help file -> Language Reference -> Loop statements

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

47 minutes ago, water said:

You need to use a Loop statement. This is described in the help file -> Language Reference -> Loop statements

Would I be able to make a loop adding a +1 to the

$username = $ArrayEmail[1]

then make it

$username = $ArrayEmail[+1]

or

$username = $ArrayEmail[++1]

 

Link to comment
Share on other sites

That's what the Loop statements do.
You set a counter variable, define the start and end value. Everything else is being done by AutoIt.

The help file and the wiki tutorial about arrays are your friends ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

7 minutes ago, water said:

That's what the Loop statements do.
You set a counter variable, define the start and end value. Everything else is being done by AutoIt.

The help file and the wiki tutorial about arrays are your friends ;)

Thanks a lot!
I will look at this when I get home.
I just ran in to another problem giving me a headache but that has nothing to do with AutoIT, but thats the world of IT I guess, troubleshooting, troubleshooting, troubleshooting and fixing things :P
Thanks again.

 

Link to comment
Share on other sites

:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...