Mart's example will work only with the most basic form of CSV files - it will fail if the record contains embedded commas. That's why you need the CSV function - it follows strict CSV rules to break on the correct commas, not just on all commas.

Testing for end of file is easy - it returns an EOF error, so just keep reading until you get an error like in Mart's or my examples. In production code, you'd want to be sure that you either A) had actual data, or B) had the proper number of fields (better choice in this situation) by checking the UBound($arrData) value before you actually process the array data.
 Code:
If Open(2,'MyFile.csv') = 0
  $aryData = CSV(ReadLine(2))
  While Not @ERROR
    ; process the array data. Since it's an array, you could prolly just
    ; use xlRangeValue to write the data, Assumes you've already created
    ; the Excel connection object, workbook, and sheet
    $ = xlRangeValue($oID, $Row + ':' + $Col, $arrData, $WorkSheet)
    $aryData = CSV(ReadLine(2))
  Loop
  $ = Close(2)
Else
  'Error opening MyFile.csv' ?
EndIf

The CSV and xlLib UDFs are available here on KORG, and the latest versions can always be found on my web site in the Resources section. You should add some error-checking to this example code.

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