Reading a text file
Show older comments
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 Comments
Michael Haderlein
on 1 Apr 2015
There are two if statements. Which one do you mean?
adrooney
on 1 Apr 2015
Accepted Answer
More Answers (0)
Categories
Find more on String Parsing 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!