Sign in to follow this  
Followers 0
Cap0

stringsplit + array

2 posts in this topic

i have a text file which has the folllowing:

info

name=cap0

age=15

endinfo

info

name=secondname

age=age

endinfo

How would i stringsplit them and get the values of name/age in an array? i can only do the first one, but just getting the name.

$f = FileRead("ttx.txt",FileGetSize("ttx.txt"))
$a = StringSplit($f,@CRLF)
$s = StringSplit($a[3],"=")
msgbox(0,'',$s[2])

that's only for "name=cap0", how would i do it with the other name/age? i'm kind of confused here.

Share this post


Link to post
Share on other sites



see _FileReadToArray()

it shows a for/next loop to search through each line of text ...

8)


NEWHeader1.png

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