필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
naadiya khudabux
naadiya khudabux 2016년 10월 18일
댓글: naadiya khudabux 2016년 10월 19일
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

채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 18일
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
Walter Roberson
Walter Roberson 2016년 10월 19일
arc_MSISDN = cell(1, numfiles);
naadiya khudabux
naadiya khudabux 2016년 10월 19일
thannkk youuu

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by