can someone tell me how can i read this text file?

1 visualización (últimos 30 días)
naadiya khudabux
naadiya khudabux el 18 de Oct. de 2016
Comentada: naadiya khudabux el 19 de Oct. de 2016
hello i have text file . i am trying to read it read it but not getting the results.
endarcfmt = ['%s', repmat('%f64',1,4)]
fid = fopen('half.txt','r');
dc = textscan(fid, arcfmt, 'HeaderLines', 1, 'Delimiter', '\t', 'EmptyValue', uint8(0), 'CollectOutput', 1)
fclose(fid);
160a01184201c500 3.63392E+18 6.04919E+18 7.30445E+18
160a011842034200 3.63392E+18 6.04919E+18 7.30445E+18
160a01184204f700 3.63392E+18 6.04919E+18 7.30445E+18
160a01184209c800 7.17463E+18 7.63062E+16 4.97705E+18
160a0118421bcb00 3.63392E+18 6.04919E+18 7.30445E+18
160a0118421bcc00 3.63392E+18 6.04919E+18 7.30445E+18
160a011842376000 1.59888E+18 4.90256E+18 8.61872E+18
160a0118423b6400 8.67273E+18 6.735E+18 3.26382E+18
160a0118424ecd00 8.67273E+18 6.735E+18 3.26382E+18
160a0118424ece00 8.67273E+18 6.735E+18 3.26382E+18
160a0118424f3200 8.67273E+18 6.735E+18 3.26382E+18
160a0118424f4e00 8.67273E+18 6.735E+18 3.26382E+18
160a0118424f6a00 8.67273E+18 6.735E+18 3.26382E+18
160a0118424f7000 8.67273E+18 6.735E+18 3.26382E+18
160a0118424f7300 2.06908E+18 8.49562E+17 8.23739E+18
160a0118424f8d00 8.67273E+18 6.735E+18 3.26382E+18
160a0118424fb700 2.06908E+18 8.49562E+17 8.23739E+18
160a0118424fb800 2.06908E+18 8.49562E+17 8.23739E+18

Respuesta aceptada

Walter Roberson
Walter Roberson el 18 de Oct. de 2016
It appears to be
dc = textscan(fid, arcfmt, 'HeaderLines', 1, 'Delimiter', '\t', 'MultipleDelimsAsOne', true, 'CollectOutput', 1);
This will only work if there are no missing column entries. If there are missing column entries then it gets complicated to try to figure out when the multiple tabs are there to make things pretty, and when there are there to indicate that the value is not present.
  11 comentarios
Walter Roberson
Walter Roberson el 19 de Oct. de 2016
arc_MSISDN = cell(1, numfiles);
naadiya khudabux
naadiya khudabux el 19 de Oct. de 2016
thannkk youuu

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by