For the first format, I would suggest a combination of Readline() to pull a while line of values in at once and GetStringToken() to split it up;
// Open file
myFile = openToRead( "data.csv" )
// Set first index of array to zero
x = 0
// Looooop
repeat
// Read whole line from file
thisString$ = readline( myFile )
// Count number of CSV parameters in line
numParts = countStringTokens( thisString$ , "," )
// If more than none - ie not a blank line
if numParts > 0
// Increase array first index
inc x
// Loop through parameters on this line, using second array index
for y = 1 to numParts
// populate array
arrayName[ x , y ] = val( getstringToken( thisString$ , "," , y ))
next y
endif
// Until the end of the file
until fileeof( myFile ) > 0
closefile( myFile )
// x will now contain the number of data lines read.
(headcoded so may contain typos)
Edit: Typo