Reading a text file
Mostrar comentarios más antiguos
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 comentarios
Michael Haderlein
el 1 de Abr. de 2015
There are two if statements. Which one do you mean?
adrooney
el 1 de Abr. de 2015
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre String Parsing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!