Jump to content
Sign in to follow this  
bflight

Reading data from a text file into AutoIT variables

Recommended Posts

bflight

Good morning!

I've created an automation script with AutoIT that basically automates the installation of a bit of software (through a .msi installer).

My script as is works - however, i'd like to make it a little more flexable in that if possible - i'd like for it to read 3 lines from a text file - and put each line into a variable that i can use when running the installer.

Basically the program i am installing requires a license, and 2 directories where bits will be places - however, each system i am installing on will require a different key, and in some cases, different paths for the 2 directories.

Ideally - my text file would be formatted like this:

<start>

C:\dir1

D:\dir2

KEY-KEY-KEY

<eol>

Can anyone point me to some example code to do this?

Thanks in advance!

Share this post


Link to post
Share on other sites
smashly

Hi,

Have a look at the AutoIt help file under:

User Defined Functions -> File Management -> _FileReadToArray

This function would probably be ideal to do what your after.

It reads a file into a 1D array.

Cheers

Share this post


Link to post
Share on other sites
bflight

Hi,

Have a look at the AutoIt help file under:

User Defined Functions -> File Management -> _FileReadToArray

This function would probably be ideal to do what your after.

It reads a file into a 1D array.

Cheers

awesome, thanks!

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  

×