Hi!
count = 1;
tline = fgetl(fid01);
while ischar(tline)
count = count + 1;
disp(tline)
if count == 3
fprintf(fid02,'%s\r\n',tline);
end
tline = fgetl(fid01);
end
fclose(fid01);
fclose(fid02);
You can do as well
for n = 1:3
tline = fgetl(fid01);
end
fprintf(fid02,'%s\r\n',tline);
fclose(fid01);
fclose(fid02);