Reading a text file
Afficher commentaires plus anciens
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 commentaires
Michael Haderlein
le 1 Avr 2015
There are two if statements. Which one do you mean?
adrooney
le 1 Avr 2015
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur String Parsing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!