Sign in to follow this  
Followers 0
polps

IniRead and non standard INI file

3 posts in this topic

Hello again, I am having some trouble with IniRead and IniReadSection functions.

The INI file has a lot of section like this (I receive it and maybe it is not a standard INI file);

[sECTION1]

KEY1 = ....

KEY2 = STRING1, STRING2, STRING3,

STRING4, STRING5

KEY3 = ...

The KEY2 is not read correctly (note that it is written in two records) because only the first part is detected by the function, and return the following result:

KEY2 = STRING1, STRING2, STRING3,

There are a workaround to detect also the STRING4, STRING5 part?

Thanks again.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Just a thought - havent tried this, but...

StringReplace(FileRead("YOUR INI FILE DESTINATION"),", "&@LF,", ")

...And then do you IniRead()

Don't hold me to this in the slightest!

EDIT:

Ok, so just tried this...

$INI=FileRead("\YOUR INI FILE DESTINATION")

MsgBox(0,"BEFORE",$INI)

$INI=StringReplace($INI,","&@CRLF,", ")

MsgBox(0,"AFTER",$INI)

You would then need to write the string back in to the file again, before using IniReadSection()

Edited by furrycow

Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites

Thank you furrycow, it work perfectly!

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