MATLAB: How to get the row and column number of floating point numeric data from an ASCII file using GUI

asciigui

Hi,
I am trying to create an app using GUI. Basically it consists on opening an ASCII file, showing every single line in a edit control and be able to identify the row numbers. Right now I am stuck in the part of figuring out how to get the first row number where the numeric data starts, as I am not interested in the header data. I have attached the text file here. The reason I show the file in the edit1 control is to find somehow a way to retrieve the row number I am interested in. Any thoughts or suggestions? Thanks
[FileName,PathName] = uigetfile('*.las','Select Well Log File');
fullpathname=strcat(PathName,FileName);
fid=fopen(fullpathname,'r');
if fid<0
error('error opening file %s\n\n',FileName);
end
text=fileread(fullpathname);
set(handles.edit1,'String',text);
fclose(fid);

Best Answer

textscan() with 'CommentStyle', {'#', '~A'}
That will tell textscan to ignore as comments all of the lines from the initial # line to the line beginning with ~A . You might need to fine-tune to deal with the rest of the line that starts with ~A .
If it is not certain that the last line of the header will be the A line then different techniques would be needed.