How do you read a file?

say I have myfile.txt:

John:Mark:Joe
Jim:Dan:Fred

Then I want to loop through the file and load each line into variables. Something like:

loop

var1=John
var2=Mark
var3=Joe

end loop;

Enter loop second time:

loop

var1=Jim
var2=Dan
var3=Fred

end loop;

end program.

How do I code this. I can't find it my book. Thanks.

I edited your post to disable the smilies..

There are many possibilities. Here is my approach...

#! /usr/bin/ksh
IFS=":"

exec < datafile

while read var1 var2 var3 ; do
#  code goes here
done

Thanks.