Reading a text file
显示 更早的评论
Hello I have this piece of code for opening a text file, but I cannot interpret some part of the code.
fid = fopen(NBIFileName);
%loops through the file and read each record in sequence
while ~feof(fid)
NBIRecord = fgetl(fid);
if feof(fid), break, end
% selects only valid highway bridges
if( NBIRecord( 19)=='1')&(NBIRecord(374) == 'Y') & ...
((NBIRecord(200)=='1')| ...
(NBIRecord(200)=='5')|(NBIRecord(200) == '6') | ...
(NBIRecord(200)=='7')|(NBIRecord(200) == '8'))
%determine the STCNTY code
STCNTY = str2num (strcat(NBIRecord(1:2),NBIRecord(30:32))););
end
I cannot understand the if statement. Could any one help me with this. Thank You
2 个评论
Michael Haderlein
2015-4-1
There are two if statements. Which one do you mean?
adrooney
2015-4-1
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 String Parsing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!