FILE OPEN READ
filem=fopen("deneme.txt","r")
if filem<0
fprintf("file could not opened..");
else
while feof(filem)==0
t=fgetl(filem);
fprintf("%s\n",t);
end
end
z=fclose(filem);
if z==0
fprintf("end of the program");
else
fprintf("an error just accured while closing the file")
end
fprintf("spesifik veriyi almak için tekrar çalıştırıyoruz\n");
newfilem=fopen("numm.txt","r");
a=1;
while a~=0
if str2num(newfilem(a))==5
fprintf("başarılı, %d",a)
a=0;
end
end
fclose(newfilem);
if filem<0
fprintf("file could not opened..");
else
while feof(filem)==0
t=fgetl(filem);
fprintf("%s\n",t);
end
end
z=fclose(filem);
if z==0
fprintf("end of the program");
else
fprintf("an error just accured while closing the file")
end
fprintf("spesifik veriyi almak için tekrar çalıştırıyoruz\n");
newfilem=fopen("numm.txt","r");
a=1;
while a~=0
if str2num(newfilem(a))==5
fprintf("başarılı, %d",a)
a=0;
end
end
fclose(newfilem);
Yorumlar
Yorum Gönder