What's wrong with this code?

Code:
  
BREAK ON
$file1 = Open(1,"activeusers.csv",5)
$inifile = "C:\Documents and Settings\Administrator.SOMEHOSP\Desktop\Admin Tools\KIX-Work\active-users.ini"
$listOfSections = readprofilestring($inifile,"","")
$splittedList = split($listOfSections,chr(10))

for each $section in $splittedList
$user=readprofilestring($inifile,$section,"user")
$os=readprofilestring($inifile,$section,"os")
$ip=readprofilestring($inifile,$section,"ip")
$date=readprofilestring($inifile,$section,"lastbootdate")
$x = Writeline(1, $section + ","+ $user + "," + $os + "," + $ip +","+ $date + @crlf)
$section + ","+ $user + "," + $os + "," + $ip +","+ $date + @crlf
;sleep 1
next




The CSV file has the first 48 or so lines correct, then it duplictes the INI file section names over again. It seems to do it as many times as I have the $section in the for..next loop.

Thanks in advance.