My data type is this:
0.000000 0.000000 0.000000 144 144 144 [1 0] d-1 0.000000 0.000000 0.000000 145 145 145 [2 0] d-1 0.000000 0.000000 0.00
0000 [3 0] d-1 0.000000 0.000000 0.000000 [4 0] d-1 0.000000 0.000000 0.000000 [5 0] D-1 0.000000 0.000000 0.000000 [6 0] d-1 0.000000 0.000000 0.000000 [7 0] d-1 0.000000 0.000000 0.00000
0 141 141 141 [8 0] d-1 0.000000 0.000000 0.000000 142 142 142 [9 0] d-1 0.000000 0.000000 0.000000 [0] D-1 0.000000 0.000000 0.000000 [0] d-1 0.000000 0.000000 0.000000 [0] d-1 0.000000 0.000000 0.00000 0 193 193 193 [513] d-1 -2.042475-4.825477 32.254028 196 196 196 [514] d66-2.047885-4.900263 32.753906 199 1 199 [515] d65-2.052787-4.975761 33.258545 [516] d64 0.000000 0.000000 0.000000 39 39 39 [1249 5 D-1 0.000000 0.000000 0.000000 [1250 545] d-1 0.000000 0.000000 0.000000 [1251 545] d-1 1. #INF00 1 . #INF00 1. #INF00 50 50[1252 545] D0 1. #INF00 1. #INF00 1. #INF00 [1253 545] D0 1. #INF00 1. #INF00 1. #INF00 [1254 545] D0 1.# INF00 1. #INF00 1. #INF00 [1255 545] D0 1. #INF00 1. #INF00 1. #INF00 [1256 545] D0 0.000000 0.000000 0.000 [1257 545] d-1 0.000000 0.000000 0.000000 bayi Bayi Bayi [1258 545] d-1 0.000000 0.000000 0.000000 78 78 78 [125 9 545] D-1 0.000000 0.000000 0.000000 The [1260 545] d-1 0.000000 0.000000 0.000000 [1261 545] d-1 0.00000
0 0.000000 0.000000 [1262 545] D-1
The length of this data is about 1000000, so I want to read the numbers. The procedure is as follows:
Clear all
close all
dispartydata = ' 1.txt ';
a1 = 1280*1024;
tmpfile= ' Tmp2.mat ';
Fidin = fopen (Dispartydata, ' R '); % open the original data file (. list)
Fidtmp=fopen (tmpfile, ' w ');% create save data file (without description text) while
~feof (Fidin)% to determine if the end of the file is
tline= Fgetl (Fidin); % reads a line of text from the file (without the return key)
if ~isempty (tline)% determines if the line is empty
[M,n]=size (tline);
flag=1;
For i=1:n% to determine if there are no corresponding characters in the row
(Tline (i) = = ' # ')
flag=0;
break;
End
End
If flag==1% if it is a numeric line, write this line of data to the file
fprintf (fidtmp, '%s\n ', tline);
End
End
End
fclose (Fidin);
Fclose (fidtmp);
[A,b,c,d,e,t,h,i,j] = Textread (tmpfile, '%f%f%f%d%d%d [%d] d%d ', A1);
A = [A,b,c,d,e,t,h,i,j];
Delete (tmpfile);