Enlever le header d'un fichier
Bonjour,
je voudrais enlever le header d'un fichier pour avoir uniquement les données. Le fichier est formaté de la manière suivante :
Citation:
[µV] 52-Height[µV] 62-Height[µV] 72-Height[µV] 82-Height[µV] 13-Height[µV] 23-Height[µV] 33-Height[µV] 43-Height[µV]
53-Height[µV] 63-Height[µV] 73-Height[µV] 83-Height[µV]
14-Height[µV] 24-Height[µV] 34-Height[µV] 44-Height[µV]
54-Height[µV] 64-Height[µV] 74-Height[µV] 84-Height[µV]
15-Height[µV] 25-Height[µV] 35-Height[µV] 45-Height[µV]
55-Height[µV] 65-Height[µV] 75-Height[µV] 85-Height[µV]
16-Height[µV] 26-Height[µV] 36-Height[µV] 46-Height[µV]
56-Height[µV] 66-Height[µV] 76-Height[µV] 86-Height[µV]
17-Height[µV] 27-Height[µV] 37-Height[µV] 47-Height[µV]
57-Height[µV] 67-Height[µV] 77-Height[µV] 87-Height[µV]
28-Height[µV] 38-Height[µV] 48-Height[µV] 58-Height[µV]
68-Height[µV] 78-Height[µV]
0.100 6.214 7.434 6.381 7.069
4.703 6.444 7.737 7.862 7.226
6.934 5.985 8.029 6.340 5.745
8.321 7.351 6.360 6.590 6.934
6.444 6.350 6.913 5.516 5.995
7.247 7.017 7.674 5.443 6.016
6.600 5.088 6.485 6.996 7.163
7.476 8.143 6.173 5.745 7.580
6.903 5.766 6.329 7.142 7.466
6.110 7.278 6.871 5.933 6.152
6.256 6.798 6.684 6.965 5.787
6.809 6.694 5.933 7.716 7.163
6.277
0.200 6.590 6.152 7.205 9.415
7.528 6.569 8.112 8.394 8.602
...
Quand j'enlève le header manuellement mon code qui marche est le suivant:
Code:
1 2 3 4 5 6
| fid = fopen(c, 'r');
a = fscanf(fid, '%f %f', [61 inf]);
a = a';
a(:,32) = [];
a(:,1) = [];
fclose(fid); |
J'ai essayé de rajouter cette partie à mon code mais sans succès :
Code:
1 2 3 4 5 6 7 8 9 10
| fid = fopen(c, 'r');
a = fscanf(fid, '%f %f')
while(a~=0.100);
a = fscanf(fid, '%f %f')
end
a = fscanf(fid, '%f %f', [61 inf]);
a = a';
a(:,32) = [];
a(:,1) = [];
fclose(fid); |
Merci pour votre aide.