sensalim Posted October 30, 2007 Share Posted October 30, 2007 Say I have file which format is like this: ########;Description\n Example: 100;Item 1 101;Item 2 102;Item 3 etc What is the easiest way to load this file, say "test.dat" into an array in my test.au3 file? I know you'd need a global array, use fileopen, filereadline etc and fileclose... but is there any easier way? Thanks. Link to comment Share on other sites More sharing options...
DW1 Posted October 30, 2007 Share Posted October 30, 2007 like _FileReadToArray()? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
weaponx Posted October 30, 2007 Share Posted October 30, 2007 #include <array.au3> #include <file.au3> Dim $tempArray _FileReadToArray("file.txt", $tempArray) _ArrayDisplay($tempArray) Dim $myArray[$tempArray[0] + 1][2] $myArray[0][0] = $tempArray[0] For $X = 1 to $tempArray[0] $temp = StringSplit($tempArray[$X], ";") $myArray[$X][0] = $temp[1] $myArray[$X][1] = $temp[2] Next _ArrayDisplay($myArray) Link to comment Share on other sites More sharing options...
sensalim Posted October 30, 2007 Author Share Posted October 30, 2007 What the, how come when I search on help file for filereadtoarray or _filereadtoarray, it came out nothing? Link to comment Share on other sites More sharing options...
DW1 Posted October 30, 2007 Share Posted October 30, 2007 old version maybe... I am on v3.2.8.1 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
sensalim Posted October 30, 2007 Author Share Posted October 30, 2007 That is also my version. Can you search for that, mine says "No topics found." This sucks. Link to comment Share on other sites More sharing options...
DW1 Posted October 30, 2007 Share Posted October 30, 2007 yes I can, its a UDF AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted October 30, 2007 Share Posted October 30, 2007 _FileReadToArray AutoIt3 Online Help 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