read header information by readtable

Hi,
I want to read the header information of a data file, like this:
EDFversion : 0
PatientID : B0018
RecordID : 02
startDate : 29.04.98
startTime : 23:18:00
headerSize : 4352
reserved :
numberDataRecord : 9711
dataRecordDuration : 3
numberSignals : 16
How do I read variable names and their values in coloumn with different data format -- some are strings, some are date & time, some are empty and some are double? Thanks in advance!

댓글 수: 5

Walter Roberson
Walter Roberson 2021년 6월 12일
is it a text file or an excel file?
The EDF Version header suggests that it is EDF format. There are functions to read EDF files, such as edfreader()
you can try to use the 'Format' field in the readTable function where you are going to read each column with a differnt format
app.meas_table = readtable(yourFile,'Format','%s%d%f');
In this case I'm going to read the first column as a string, the second as a integer and the third one as a float
%d: integer
%s: String
For the date format I suggest you to read it as a string.
Let me know if it works
Walter Roberson
Walter Roberson 2021년 6월 12일
Format can only be used for text files, and at the moment we do not know the file format.
Bolun Chen
Bolun Chen 2021년 6월 12일
Hi, Walter! It's a .txt file. Thanks!

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

질문:

2021년 6월 12일

댓글:

2021년 6월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by