processing a text file

I want to process a text file that reads lines delimited by a return character.The problem is that the applescript is not recognising the return character as a delimiter.

–The script allows us to choose the tab-delimited file, opens it for access
–and read the data from the file into a variable using a return as the delimiter.
–This gives us a list in which each item is one line, or record, from the file.

set theFile to choose file with prompt “Choose a tab-delimited text file”
open for access theFile
set theData to read theFile using delimiter (return)
close access theFile

display dialog (count of theData)

The result of the dialog is always 1.
help is greatly appreciated.
Chris.

If you simply want to read the entire file, this should work. If you want to read it line by line, this isn’t the answer.

set theFile to choose file with prompt "Choose a tab-delimited text file"
set theData to paragraphs of (read theFile)
display dialog (count of theData)

– Rob

yeah,i want to read the file line by line and extract various fields from each record.Unfortunately,the script isnt recognising return as a text delimeter.
Cheers rob

Are you sure the line ending is a return (ASCII character 13)? Could it be be ASCII character 10?

– Rob