the wfdb toolbox available at physionet offers the function "rdann" to read such files. Apart from using the c version of rdann there are also wrappers for matlab available on physionet.
thanks for reply, I want to ask how I can divide the the ECG signal to beats and make matrix with each type of beats group, As I found when I run the recommended commend that the beats not arranged as beat no 300 the next is no 439 for example