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()
Sebastiano Marinelli
Sebastiano Marinelli 2021 年 6 月 12 日
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!
Walter Roberson
Walter Roberson 2021 年 6 月 12 日

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData 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