MATLAB: Reading lines from a .raw file and storing them into an array

.raw filearraycellmatrixopen filerawreadread file

I have some data in a .raw file as shown below:
ADDR,CH0,CH1,CH2,CH3,CH4,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CAL,NUM
####,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,#
...
...
The first and last column indicates a number and the ffff represents a hex value. There are 13 rows in this file. I need to write a program which reads each line, and stores each line into an array(matrix) to be used later. The only column I will have to ignore is ADDR and I need and array from CH0 to NUM with all the values in each column but I'm having difficulty trying to read the file.
So far I have used this:
fid = fopen(file_raw);
tline = fgetl(fid);
while ischar(tline)
disp(tline)
tline = fgetl(fid);
end
fclose(fid);
But it only displays the content on the file. I would appreciate any suggestions!!

Best Answer

fid = fopen('temp.txt','rt');
hdr = regexp(fgets(fid),',','split');
fmt = repmat('%s',1,numel(hdr));
C = textscan(fid,fmt,'Delimiter',',');
fclose(fid);
C = horzcat(C{:});
tested on this file: