I have 100+ EEG EDF files. I want to extract the start time and date along with the recording duration into a data frame. Is there any easy way to extract this data? Preferabely in R or Matlab.
I have succesfully extracted the data using:
library(edfReader)
CHdr <- readEdfHeader("E:/data/EDF/Rtest/EEG1 (2).edf")
summary(CHdr)
format (CHdr$startTime, format="%Y-%m-%d %H:%M:%S", usetz = FALSE)
CHdr$recordedPeriod
But doing this for the 100+ EDF files, might get a bit tiresome...
You can use
lapply
withreadEdfHeader
to get all the headers in one code line.First, a working example with the package data sets.
Get the
.edf
filenames and read their headers.Next, extract the relevant information and
rbind
it to create a data.frame.Reset the working directory.