Alpinestar Posted April 16, 2009 Share Posted April 16, 2009 Hello Probably a really silly solution to this, but Im trying to read a ini file with 2 values with a random Section Name i.e [Computer Name 1] IP= 1.1.1.1 Mac=001AA0BC8A12 [Name computer 2] IP= 1.1.1.2 Mac=001AA0BC898C [Random Name 3] IP= 1.1.1.3 Mac=001AA0BC92C0 However I am getting the results on 2 different lines rather then one. So instead of 2009-04-16 13:32:05 : Computer Name is : VTG000005 IP is : 192.168.212.78 Mac is : 001AA0BC8A12 I'm getting 2009-04-16 13:32:05 : Computer Name is : VTG000005 IP is : IP Mac is : 192.168.212.78 2009-04-16 13:32:06 : Computer Name is : VTG000005 IP is : Mac Mac is : 001AA0BC8A12 #include<file.au3> $sar = IniReadSectionNames(@ScriptDir & "\Woz.ini") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $s = 1 To $sar[0] MsgBox(4096, "", $sar[$s]) $var = IniReadSection("G:\FourS\SiteShare\CentraStage\woz.ini", $sar[$s]) For $i = 1 To $var[0][0] MsgBox(4096, $sar[$s], "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1]) _FileWriteLog(@ScriptDir & "\Woz.log", "Computer Name is : " & $sar[$s] & " IP is : " & $var[$i][0] & " Mac is : " & $var[$i][2]) Next Next EndIf Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 16, 2009 Share Posted April 16, 2009 $sar = IniReadSectionNames(@ScriptDir & "\Woz.ini") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $s = 1 To $sar[0] $var = IniReadSection("G:\FourS\SiteShare\CentraStage\woz.ini", $sar[$s]) _FileWriteLog(@ScriptDir & "\Woz.log", "Computer Name is : " & $sar[$s] & " IP is : " & $var[1][1] & " Mac is : " & $var[2][1]) Next EndIf [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
Alpinestar Posted April 16, 2009 Author Share Posted April 16, 2009 Wow, that was quick Thanks for your help WideBoyDixon, it works a treat Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now