Jump to content
Sign in to follow this  
Dampe

File reading

Recommended Posts

Dampe

If I have a file, with lines set out like this:

<Mage.AI> 1 </Mage.AI>

what would be the best way to go about reading whats inside the brackets (in this case, the 1)

Some sort of _ArraySearch with StringinStr?

Thanks.


Share this post


Link to post
Share on other sites
weaponx

_FileReadtoArray()

_StringBetween()

Share this post


Link to post
Share on other sites
spudw2k

I'm sure you can do this with a regular expression, but I'm kinda fuzzy on that subject. Search the help file for StringRegExp(). I'm sure someone else will post an example of how to do it that way.

Share this post


Link to post
Share on other sites
weaponx

I'm sure you can do this with a regular expression, but I'm kinda fuzzy on that subject. Search the help file for StringRegExp(). I'm sure someone else will post an example of how to do it that way.

Well...if you need every value between the tags you can use _StringBetween by itself and it will return an array of all matches.

Share this post


Link to post
Share on other sites
Dampe

_StringBetween seems to work perfect

Thanks for the help guys =]


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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.