MATLAB: Help using textscan on a .dat file

.datloadreading datatextscan

Hi guys,
I'm having some trouble trying to automaticallly load .dat files in my matlab code.
I'm pretty sure I know what the problem is but here's the error message anyway:
Error using load
Number of columns on line 201
of ASCII file G:\Thesis
DATA\New
Test\sunday_test_4.dat must be
the same as previous lines.
Basically my .dat file is pretty standard, it has a time column followed by 16 channel of transducer depth values.
The problem is the final line of the file has a date line which has less columns than the rest and so the process fails here.
An example of the final lines of text within the file is shown below.
17:01:07.458 10.28 10.40 10.50 10.44 10.46 10.40 10.32 10.20 10.23 10.40 10.68 10.66 10.80 10.80 10.74 10.83
17:01:15.459 10.26 10.40 10.49 10.50 10.47 10.43 10.32 10.23 10.29 10.38 10.57 10.65 10.77 10.81 10.71 10.86
17:01:23.459 10.28 10.44 10.43 10.46 10.49 10.47 10.32 10.28 10.34 10.38 10.56 10.62 10.83 10.81 10.71 10.77
17:01:31.459 10.34 10.40 10.49 10.52 10.49 10.50 10.38 10.26 10.29 10.44 10.56 10.65 10.80 10.81 10.72 10.75
Data end time 07/12/2015 17:03:55
And here is my code so far:
[filename2, directory_name2] = uigetfile('*.dat', 'Load the test data');
fullname2 = fullfile(directory_name2, filename2);
C3=load(fullname2);
C1 =textscan(C3,'%s %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32');
Simply put, I need the code to either ignore the final line within the .dat file or to store it somehow (the latter would be ideal).
However the number of lines within the .dat file changes depending on how long I leave the transducers running for, therefore I cant simply make the program ignore the 201'st line because it may be different the next time.
However it IS always the last line, so if there's a way of doing it, it shouldn't be that difficult. I'm just not sure how.
Any help would be greatly appreciated, Many Thanks, Nath

Best Answer

[filename2, directory_name2] = uigetfile('*.dat', 'Load the test data');
fullname2 = fullfile(directory_name2, filename2);
fid = fopen(fullname2, 'rt');
C1 = textscan(fid,'%s %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32 %f32', 'CommentStyle', 'Data');
fclose(fid);
That is, lines that begin with 'Data' are to be treated as comments and discarded.