Sign in to follow this  
Followers 0
computergroove

Help with _FileReadToArray

5 posts in this topic

I have a file that changes values on occaision that looks like:

1;1
2;2
3;3
4;4
5;7
9;3

The file in called text.ini. I want to read these into a 2d array and I cannot find any examples of anyone doing it and I do not understand the function reference on the net. Can someone show me the correct syntax?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites



 

I have not used the function, but to me the writeup sounds like:

Local $aRead 

_FileWriteFromArray("c:\text.ini", $aRead , Default, Default, ";")
If Not @error then
_ArrayDisplay($aRead)
EndIf

I tried:

#include <Array.au3>
#Include <File.au3>

Local $aRead
Local $Path = @DesktopDir & "\text.ini"
_FileWriteFromArray($Path, $aRead , Default, Default, ";")
If Not @error then
    _ArrayDisplay($aRead)
EndIf

And it did nothing. No error either.


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#include <Array.au3>
#Include <File.au3>

Local $aRead[][]=[[0],[0]]
Local $Path = @DesktopDir & "\temp.ini"
_FileReadToArray($Path, $aRead, 0, ";")
If Not @error then
    _ArrayDisplay($aRead)
EndIf

There was a typo and I got the above to work.


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Haha, oops. Wrote too fast :D

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