How can I read informations of an ASCII header
1 view (last 30 days)
Show older comments
I have this type of ascii file:
ncols 1001
nrows 1001
xllcorner 32463999.5
yllcorner 6099999.5
cellsize 1
nodata_value -999.00
-0.50 -0.49 -0.50 -0.53 -0.58 -0.61 -0.60 -0.57 ...
so how can I read the header information xllcorner and yllcorner ?
thansk a lot xoxo
0 Comments
Answers (1)
KSSV
on 21 Feb 2019
fid = fopen('data.txt') ;
count = 0 ;
iwant = zeros(5,1) ;
while 1
count = count+1 ;
tline = strsplit(fgetl(fid)) ;
iwant(count) = str2num(tline{2}) ;
if count == 5
break
end
end
fclose(fid) ;
0 Comments
See Also
Categories
Find more on Low-Level File I/O in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!