Reading data from a .data file

조회 수: 15 (최근 30일)
Jakob Sievers
Jakob Sievers 2023년 11월 8일
댓글: Voss 2023년 11월 8일
Hi there
I'm having some problems figuring out how to read the data in a bunch of .data files that look like below when opened in notepad. Can anyone help?
Thanks in advance
Instrument: AIU-2371
File Type: 2
Software Version: 8.9.0
Timestamp: 19:10:54
Timezone: UTC
DATAH Seconds Nanoseconds Sequence Number
DATA 1661800254 300000000 10036541
DATA 1661800254 400000000 10036571
DATA 1661800254 500000000 10036601
DATA 1661800254 600000000 10036631
(etc...)

채택된 답변

Voss
Voss 2023년 11월 8일
readtable with 'FileType' and 'NumHeaderLines' parameters specified may work:
% I zipped the example .data file I made, in order to upload it;
% unzip the zip file now:
unzip test.zip
% read the file:
T = readtable('test.data','FileType','text','NumHeaderLines',5)
T = 4×5 table
DATAH Seconds Nanoseconds Sequence Number ________ __________ ___________ __________ ______ {'DATA'} 1.6618e+09 3e+08 1.0037e+07 NaN {'DATA'} 1.6618e+09 4e+08 1.0037e+07 NaN {'DATA'} 1.6618e+09 5e+08 1.0037e+07 NaN {'DATA'} 1.6618e+09 6e+08 1.0037e+07 NaN
If that doesn't work, zip (or change the extension of) one or more of your .data files and upload it/them here using the paperclip button.
  댓글 수: 2
Jakob Sievers
Jakob Sievers 2023년 11월 8일
YES!
That was exactly what I was looking for. I had actually looked at it too but for some reason I couldn't get it to work.
Thank you so much!
Voss
Voss 2023년 11월 8일
You're welcome!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by