Sign in to follow this  
Followers 0
BryonR

[SOLVED] FileReadLine - create variable for each line

5 posts in this topic

#1 ·  Posted (edited)

I have a text file that is dynamic and can be anywhere from 1 to 4 lines of information (numbers).

I'm trying to create a script that will look at those lines and populate each line as a seprate variable. However I'm at a loss on the second part.

Is there away to have autoit define the next variable if next line exists?

Thanks!

Bryon

Edited by BryonR

Share this post


Link to post
Share on other sites



_FileReadToArray()

Share this post


Link to post
Share on other sites

_FileReadToArray()

Thank you!

It morphed into the following code.

#include <IE.au3>
#include <file.au3>
$PACScallnumbers = "c:\test\pagernumbers.txt"
$message = "please call department"
Dim $aRecords
If Not _FileReadToArray($PACScallnumbers,$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    $website = "https://www.arch.com/cgi-bin/wwwpage.exe?PIN="&$aRecords[$x]&"&MSSG="&$message&"&Q1=0"
    $oIE = _IECreate ($website, 0, 0, 1, 0)
Next

Share this post


Link to post
Share on other sites

and how to do this if you have a string separated by spaces?

like:

$string = "hey my name is carlos"

msg(1,"What's your name",$string[5])

Share this post


Link to post
Share on other sites

and how to do this if you have a string separated by spaces?

like:

$string = "hey my name is carlos"

msgbox(1,"What's your name",$string[5])
StringSplit()

$string = "hey my name is carlos"
$String = StringSplit($String, " ")
msgbox(0,"What's your name",$string[5])

Share this post


Link to post
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
Sign in to follow this  
Followers 0