CSV is more than simply fields separated with commas.

Per the example in the manual, you open a file, then read the first line. Then you enter a loop waiting for the end-of-file error. You read the next line at the end of the loop.

Get the CSV UDF and include it in your code, and try the following:
 Code:
; Assumes CSV() is loaded/included

$csv="C:\temp\test.csv"
Open(3,$csv) = 0
$read=CSV(ReadLine(3))  ; read first line
While Not @ERROR  ; loop until EndOfFile error occurs
  $csv_array[5] ? ;this is the account# field
  $csv_array[66] ? ;this is the balance field
  $read=CSV(ReadLine(3))
Loop
$ = Close(3)


For item 2, a simple way is to add the account number to a string, delimited with some chars,
$Accts = $Accts + '~' + $csv_array[5] + '~'

then use
If Not Instr($Accts,'~' + $csv_array[5] + '~')
; add to subtotal
; then add account number to $Accts string
EndIf

Appending them to an array and using AScan is a good alternative, but a tad more complex.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D