Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted (edited)

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!

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
×
×
  • Create New...