Jump to content
Sign in to follow this  
Tec

IniWrite

Recommended Posts

Tec

I scan my network and write the result at ini file with Iniwrite.

Example:

IniWrite($sIni, $list[$i], "TAG", $strTag) 
IniWrite($sIni, $list[$i], "USER", $strUser)

$list[$i] is Computer name like PC1 PC2 PC3 ....

Every scan I update the file or add new computer. I need for better clear view a line breake between the Sections. If i add a @CRLF at last iniwrite, every scan i add a new line break. But i need only one line break between Sections. Dont now how i can manage that.

Need a littel help pls

Share this post


Link to post
Share on other sites
FinalVersion

I scan my network and write the result at ini file with Iniwrite.

Example:

IniWrite($sIni, $list[$i], "TAG", $strTag) 
IniWrite($sIni, $list[$i], "USER", $strUser)oÝ÷ ÛMú+-Ó~¢À¨­z¹ÚébãÂÔð¶

Before every section add a @CRLF.

Share this post


Link to post
Share on other sites
Tec

thx for replay but

If i add a @CRLF at last iniwrite, every scan i add a new line break. But i need only one line break between Sections. Dont now how i can manage that.

Share this post


Link to post
Share on other sites
rudi

As i said in my post above, just add @CRLF after each "new" section.

He also is updating sections, by that the double CRLF will become tripple, quadruple, ...

He will need to add the space lines as before.

Then "cleanup double space lines" in a 2nd step:

$INI_handle=FileOpen("C:\test.ini",0)
$Full_INI=FileRead($INI_handle)
FileClose($INI_handle)

$Fixed_INI=StringRegExpReplace($Full_INI,"(\r\n){2,}",@crlf & @crlf)

$INI_handle=FileOpen("C:\test.ini",2)
FileWrite($INI_handle,$Fixed_INI)
FileClose($INI_handle)

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
rudi

thx rudi that works

you're welcome, rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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.