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
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
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
2021년 6월 12일
Format can only be used for text files, and at the moment we do not know the file format.
Bolun Chen
2021년 6월 12일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!