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 Comments

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
Format can only be used for text files, and at the moment we do not know the file format.
Hi, Walter! It's a .txt file. Thanks!

Sign in to comment.

Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Asked:

on 12 Jun 2021

Commented:

on 12 Jun 2021

Community Treasure Hunt

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

Start Hunting!