|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jun 2007
Messaggi: 768
|
[Matlab] leggere file di testo malformato
Salve,
ho un file di testo "malformato": è simile a un file .CSV ma Matlab non riesce a leggerlo in modo automatico. Le ho provate tutte importdata, fopen, textscan etc. ma non sono riuscito a leggere il file... parte del file da leggere Codice:
Forward Packet,Sequence,Time stamp,Delta (ms),Jitter (ms),Skew(ms),IP BW (kbps),Marker,Status 976,61063,0,0.00,0.00,0.00,10.18,,[ Ok ],02/15/2010 14:58:29.639,1286 977,61064,0,0.26,0.02,-0.26,21.04,,[ Ok ],02/15/2010 14:58:29.639,1372 978,61065,0,0.23,0.03,-0.49,26.94,SET,Incorrect timestamp,02/15/2010 14:58:29.639,752 1004,61066,249000,212.21,159.68,2553.96,32.44,SET,[ Ok ],02/15/2010 14:58:29.852,701 codice matlab Codice:
fid = fopen('h263w.txt','r');
InputText=textscan(fid,'%s',2,'delimiter','\n'); % Read strings delimited by a carriage return
format = '%f %f %f %f %f %f %f %s %s %f %f';
i=1; % Initialize block index
while (i ~=10) % For each block...
A = textscan(fid, format, 'delimiter',',')
for j=1:7
data(i,j) = A(1,j);
end
i=i+1;
end
fclose(fid);
Non so come fare...grazie |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 07:28.



















